Validation in as400 trigger

270 pts.
Tags:
AS400 Trigger Program
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.
ASKED: December 21, 2012  11:29 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    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
    125,585 pointsBadges:
    report
  • LakNar
    Tom, i could not get u.. I have to use my DB2 name(Eg: TRGPF) in TOPGMQ parameter ?
    270 pointsBadges:
    report
  • TomLiotta
    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
    125,585 pointsBadges:
    report
  • LakNar
    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 ? 
    270 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following