|
midrange-l-request@xxxxxxxxxxxx wrote:
> 9. Re: Quick-and-dirty *MSGW? (jamesl@xxxxxxxxxxx)
>
>Peter Vidal suggested:
>> START: PGM
>> CHKOBJ OBJ(QSYS/XXXXXXXXXX) OBJTYPE(*USRSPC)
>> END: ENDPGM
>
>Thanks.
>
>As to why, well, I'm working on a program that scans through all active
>jobs with a particular jobname, and needs to be able to recognize which
>ones are in *MSGW state (which would indicate that they're stuck in an
>error condition).
James:
In that case, this little CL will help you. It produces the three fundamental
causes of MSGW status in succession. You'll want to distinguish between the
three:
DCL VAR(&REPLY) TYPE(*CHAR) LEN(80)
RCVMSG MSGQ(MYLIB/MSGW) WAIT(300)
SNDUSRMSG MSG('Enter reply') MSGTYPE(*INQ) +
TOMSGQ(MYLIB/MSGW) MSGRPY(&REPLY)
SNDMSG MSG('Enter reply') TOMSGQ(MYLIB/MSGW) +
MSGTYPE(*INQ)
Note that the last SNDMSG produces a "Waiting on response from QSYSOPR" error
condition. The RCVMSG will wait 5 mins or until you send a message to
MYLIB/MSGW. The SNDUSRMSG will wait on a reply from MYLIB/MSGW. Both the
SNDUSRMSG and the SNDMSG waits can be handled via the <option 7=Display
message> function such as from WRKSBMJOB.
Tom Liotta
--
Tom Liotta
The PowerTech Group, Inc.
19426 68th Avenue South
Kent, WA 98032
Phone 253-872-7788 x313
Fax 253-872-7904
http://www.powertech.com
__________________________________________________________________
McAfee VirusScan Online from the Netscape Network.
Comprehensive protection for your entire computer. Get your free trial today!
http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397
Get AOL Instant Messenger 5.1 free of charge. Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promo=380455
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.