|
I tried it with Wait(0) as Wait(*no) does not exist. All it does it rcv the message queue and if there is no message, it does it again. It never sends a CPF message. Chris Beck >>> jlangston@celsinc.com 08/03/01 11:23AM >>> Before your LOOP, add a loop that does the exact same thing, but does not wait if msgs are not available WAIT(*NO) maybe? I forget. Add CPF0000 right after it going to LOOP. Then go back and do it again. Something like this (untested code): CLEARQUE: RCVMSG MSGQ(QSYS/QSYSOPR) WAIT(*NO) RMV(*NO) + MSG(&MSG) MSGDTA(&MSGDTA) MSGID(&MSGID) + MSGF(&MSGF) MSGFLIB(&MSGFLIB) MONMSG MSGID(CPF0000) DO GOTO LOOP GOTO CLEARQUE LOOP: RCVMSG MSGQ(QSYS/QSYSOPR) WAIT(*MAX) RMV(*NO) + MSG(&MSG) MSGDTA(&MSGDTA) MSGID(&MSGID) + MSGF(&MSGF) MSGFLIB(&MSGFLIB) ... What this should do is receive any messages already on the queue when the program starts but not do anything with them. When there are no more messages available (the CPF0000 should be triggered?) you start your regular cycle. Make sure if you do it this way you debug it, this is totally untested. Regards, Jim Langston -----Original Message----- From: owner-midrange-l@midrange.com [mailto:owner-midrange-l@midrange.com]On Behalf Of Chris Beck Sent: Friday, August 03, 2001 7:09 AM To: MIDRANGE-L@midrange.com Subject: Qsysopr message program. I have a CL program that monitors Qsysopr for certain messages, then emails the appropriate person that the message should go to . The problem I have is that on one machine we take it down to a restricted state for its nightly backups. Then when the machine starts back up, it starts the message program. Then it reads all messages in qsysopr that it has not read before, and sends out the emails from machine startup. I don't want to recieve all the past messages, I would like the program to start, but not read any of the past messages and only new ones that come in. I don't wan't to monitor for all the startup messages, because then when they are sent another time I won't recieve them. Any suggestions? Here is a sample of how the program works. LOOP: RCVMSG MSGQ(QSYS/QSYSOPR) WAIT(*MAX) RMV(*NO) + MSG(&MSG) MSGDTA(&MSGDTA) MSGID(&MSGID) + MSGF(&MSGF) MSGFLIB(&MSGFLIB) /* MESSAGES TO IGNORE */ IF COND(&MSGID = 'CP13710') THEN(GOTO + CMDLBL(LOOP)) IF COND(&MSGID = 'CPC1236') THEN(GOTO + CMDLBL(LOOP)) /* FORMAT THE SUBJECT */ IF COND(&MSGID = ' ') THEN(CHGVAR + VAR(&EMSGID) VALUE('GSSASDEV-MESSAGE')) ELSE CMD(CHGVAR VAR(&EMSGID) + VALUE('GSSASDEV-MSG ID:' *BCAT &MSGID)) /* EMAIL THE MESSAGE */ SNDDST TYPE(*LMSG) TOINTNET(('xyz@GOOD-SAM.COM') ('abc@GOOD-SAM.COM' *CC)) DSTD(&EMSGID) LONGMSG(&MSG) GOTO LOOP Thanks Chris Beck +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.