Hi,
I am using CLLE trigger program to validate a pf. During any invalid data is inserted, i would to show a error using SNDPGMMSG
SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('ERROR') +
TOPGMQ(*PRV) MSGTYPE(*ESCAPE)
But when i tried to insert the invalid data, the insert operation is rejected, but the error message is not showing in the screen. Instead " Message CPF502B was issued." is showing. When i use DSPMSGD and see , it is showing " Error occurred in trigger program." . How to get my original CPF message in my trigger program ? My Version is V5R3M0.
Software/Hardware used:
ASKED:
December 21, 2012 11:29 AM
If you send an *ESCAPE message to TOPGMQ(*PRV) from a trigger program, you’re telling DB2 that the trigger program has failed somehow. The previous program (i.e., *PRV) for a trigger program is always DB2 since DB2 is always what calls trigger programs. — Tom
Tom, i could not get u.. I have to use my DB2 name(Eg: TRGPF) in TOPGMQ parameter ?
i could not get u..
If PGMA calls PGMB and PGMB sends an *ESCAPE message to TOPGMQ(*PRV), the message is sent to the program message queue of PGMA.
But that’s not what you are doing. PGMA isn’t calling your trigger program, so your trigger program can’t send a message PGMA by using TOPGMQ(*PRV). PGMA isn’t the “previous” program.
In your case, FILEA has your program as a trigger. PGMA attempts to update FILEA, and DB2 calls your trigger program. So, DB2 is the “previous” program.
Trigger programming is a little different from usual programming. You need to learn a little more about how to send messages. You might start by reviewing the Stored Procs, Triggers, and UDFs on DB2 Redbook (HTML version). Look into Chapter 11, topic 11.3 Trigger feedback to application programs, for some explanation.
It should help you understand what is happening. After that, it might be easier to figure out how you want to handle it.
Tom
Thanks tom, as specified in Topic 11.3 in the given red book, i am also receiving “Message CPF502B was issued” message in UPDDTA command. Actually i am sending CPF9898 from QCPFMSG to QMHSNDPM API plist. Can i make this message to display in my DFU.? Or we can display only CPF502B in the DFU session ?