|
On 10/22/2018 5:11 PM, a4g atl wrote:
I created a program to compile physical files. The program is crashingand
because I have an error.
I need to monitor for errors CPF7301 and send a cancel reply to the
system/program creating the file. Its been a long time since I did this
remember adding a temporary entry to the reply list to get the cancel in.
I looked at SNDRPY but that does not look like the appropriate command to
use.
MONMSG in a CLP will avoid having to reply to any message in the first
place. If memory serves, CRTPF issues a 7302 when it fails. If the
program is getting a 7301, it would be a diagnostic.
Here is a very brief example of a CLP handling errors. It inspects
diagnostic messages, and if we expect them, we let the CLP continue. If
not, we set a 'job bombed' flag that will let the operator know. The
goal of all of this code is to have the CLP run to completion without
ever issuing a white message.
SAVLIB...
MONMSG MSGID(CPF0000) exec(goto lib_err)
goto sav_str
lib_err:
/* get a message key that will serve to mark the end */
/* of the process we're monitoring */
sndpgmmsg 'stop savlib' topgmq(*same) keyvar(&key_stop)
rmvmsg msgkey(&key_stop)
/* calculate the first possible diagnostic message */
chgvar %bin(&msgkey 1 4) (%bin(&key_start 1 4) + 1)
getlibmsg:
/* get the diagnostic message */
RCVMSG PGMQ(*SAME (*)) +
MSGTYPE(*DIAG) RMV(*no) MSGDTA(&MSGDTA) +
MSGID(&MSGID) msgkey(&msgkey)
monmsg cpf2410 exec(do) /* msg not found */
rcvmsg msgtype(*excp) rmv(*yes) /* delete unwanted msg */
goto nxtlibmsg
enddo
/* if empty, all done */
if (&msgid *eq ' ') goto sav_str
/* here is where we see if the messages are ones */
/* we know about or not. If the message being */
/* considered is NOT one we expect, set the flag */
/* some *diag messages we expect and don't worry about */
/* cpf4198 open seqonly(*yes) */
/* cpf3761 cannot use object */
/* cpf3771 x objects saved, y objects not saved */
/* cpf4024 tape density difference */
if ((&msgid *ne 'CPF4198') *and +
(&msgid *ne 'CPF3761') *and +
(&msgid *ne 'CPF3771') *and +
(&msgid *ne 'CPFA0A9') *and +
(&msgid *ne 'CPF4024')) do
chgvar &expected 'N'
chgvar &msgdsp ('Unexpected SAVLIB message ' *cat &msgid)
SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) +
msgdta(&msgdsp) +
MSGTYPE(*info) tousr(itmc)
MONMSG (CPF0000 MCH0000)
goto sav_str
enddo
/* check out the 'cannot use' messages' */
if (&msgid *ne 'CPF3761') do
goto nxtlibmsg
enddo
/* 'OBJECT TYPE LIBRARY ' */
if ((&msgdta *ne 'ALLFTM100 DTAQ ALLFTM100 ') *and +
...
(&msgdta *ne 'QGLDLOCK USRSPC QUSRDIRDB ') *and +
(%sst(&msgdta 11 17) *ne 'MGTCOL QPFRDATA ')) do
chgvar &expected 'N'
chgvar &msgdsp ('Unexpected SAVLIB data ' *cat %sst(&msgdta 1 30))
SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) +
msgdta(&msgdsp) +
MSGTYPE(*info) tousr(itmc)
MONMSG (CPF0000 MCH0000)
goto sav_str
enddo
nxtlibmsg:
/* increment the message key */
chgvar %bin(&msgkey 1 4) (%bin(&msgkey 1 4) + 1)
if (&msgkey *lt &key_stop) goto getlibmsg
/* At this point, job log gets CPF3777 nnn libraries saved */
/* ============================================================= */
...
--
--buck
http://wiki.midrange.com
Your updates make it better!
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD
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.