|
Thanks for your help Simon! I was in the middle of no-where. Have a great day. "Simon Coulter" <shc@flybynight.com To: midrange-l@midrange.com .au> cc: Sent by: Subject: Re: Command messages midrange-l-admin@mi drange.com 03/28/2002 06:41 PM Please respond to midrange-l Hello Peter, You wrote: >CLRPFM FILE(MYLIB/MYFILE) >Is this valid? >MONMSG MSGID(CPF0000) EXEC(DO) >RCVMSG MSGTYPE(*COMP) MSGDTA(&MSGDTA) MSGID(&MSGID) >SNDPGMMSG MSGID(&MSGID) MSGF(QCPFMSG) MSGDTA(&MSGDTA) + > MSGTYPE(*COMP) >ENDDO Not valid! 1. You can't monitor for a completion message so the code in the DO group will only run if an exception occurs. 2. If an exception occurs the message won't be a completion message 3. You can't reliably receive a *COMP message anyway because receiving a non-exception message gets the first one which may not be from the CLRPFM. >What am I doing wrong? Simply do the RCVMSG and SNDPGMMSG in-line for completion messages. Receive the *LAST message after the CLRPFM which will get you the completion message. For example: CLRPFM FILE(MYLIB/MYFILE) RCVMSG MSGTYPE(*LAST) MSGDTA(&MSGDTA) MSGID(&MSGID) SNDPGMMSG MSGID(&MSGID) MSGF(QCPFMSG) MSGDTA(&MSGDTA) + MSGTYPE(*COMP) Let your global MONMSG handle any exceptions. If you must handle exceptions on the CLRPFM *and* forward the completion message then do: CLRPFM FILE(MYLIB/MYFILE) MONMSG MSGID(CPF0000) EXEC(DO) /* Whatever recovery you need */ GOTO SKIP_COMP ENDDO RCVMSG MSGTYPE(*LAST) MSGDTA(&MSGDTA) MSGID(&MSGID) SNDPGMMSG MSGID(&MSGID) MSGF(QCPFMSG) MSGDTA(&MSGDTA) + MSGTYPE(*COMP) SKIP_COMP: Regards, Simon Coulter. -------------------------------------------------------------------- FlyByNight Software AS/400 Technical Specialists http://www.flybynight.com.au/ Phone: +61 3 9419 0175 Mobile: +61 0411 091 400 /"\ Fax: +61 3 9419 0175 mailto: shc@flybynight.com.au \ / X ASCII Ribbon campaign against HTML E-Mail / \ -------------------------------------------------------------------- _______________________________________________ This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l or email: MIDRANGE-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.