Your edit macro ALTER performs two different functions: it changes all
occurrences of one string to another and submits a job.  Either of these
could fail.  Which would you like the return code to reflect?

You could initialize a local variable to 0 near the top of your macro.
After issuing the CHANGE command, you could test &LASTCC and if non-zero add
some value to the local variable.  You could do the same after issuing the
SUBMIT command (with a different value).  At the end of your macro you could
EXIT with this local variable.  In your CLIST, you could examine this
returned value (in &LASTCC) and take the appropriate action depending on
whether the CHANGE, the SUBMIT, or both failed.

In the case of CHANGE failing, there are different types of failures.  The
value you add to the local variable could reflect the type of failure.  It
all depends on how detailed you need the code to be.

By the way, the FIND does not seem to serve any purpose.  Nor do the local
variables LROW, LCOL, and LNUM.

:>: -----Original Message-----
:>: From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
:>: Behalf Of esst...@juno.com
:>: Sent: Saturday, May 11, 2013 12:44 PM
:>: To: IBM-MAIN@LISTSERV.UA.EDU
:>: Subject: Examing & Setting Return Codes in a CLIST/MACRO
:>:
:>: Hi,
:>: Not proffecient in CLISTS and RExx.
:>:
:>: Can I get some assistance with examining & testing a return code in a
:>: CLIST Macro.
:>:
:>: In A CLIST i execute the following statements to edit a member of a PDS
:>: and use the ALTER MACRO to change all occurances of XXXXXXX.
:>: SET IOFUNC  = &STR(EDIT)
:>: ISPEXEC EDIT DATASET('&JCLLIB(CATLOG42)') MACRO(ALTER)
:>:
:>:
:>: The ALTER MACRO Executes/ Changes the VALUE OF XXXXXXX correctly,
:>: submits
:>: the JOB and then CANCELS The Edit session.
:>:
:>: Here is the EDIT Macro
:>: ISREDIT MACRO
:>: SET LROW = 00
:>: SET LCOL = 00
:>: SET LNUM = 00
:>:
:>: ISPEXEC VGET (V0) SHARED
:>: ISREDIT FIND XXXXXXX
:>: ISREDIT CHANGE 'XXXXXXX' '&V0' ALL
:>: ISREDIT SUB
:>: ISREDIT CAN
:>:
:>: EXIT
:>:
:>:
:>:
:>: My question is How Do I properly Test and SET the Return Code in the
:>: EDIT MACRO. Can I use &LASTCC ?
:>: I need some examples as to how to examine and Set the Return code in the
:>: ALTER MACRO.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to