Re: Examing Setting Return Codes in a CLIST/MACRO

2013-05-13 Thread Shmuel Metz (Seymour J.)
In 20130511.154412.1327...@webmail03.dca.untd.com, on 05/11/2013
   at 07:44 PM, esst...@juno.com esst...@juno.com said:

My question is How Do I properly Test and SET the Return Code in the
EDIT MACRO

LASTCC and MAXCC to test.

EXIT CODE(foo) to set.

Any examples would be appreciated.

  ISREDIT MACRO
  SET LROW = 00
  SET LCOL = 00
  SET LNUM = 00

  ISPEXEC VGET (V0) SHARED
  ISREDIT FIND XXX
  ISREDIT CHANGE 'XXX' 'V0' ALL
  ISREDIT SUB
  IF LASTCC  0 THEN EXIT CODE(4)
  ISREDIT CAN
  EXIT CODE(0)

-- 
 Shmuel (Seymour J.) Metz, SysProg and JOAT
 Atid/2http://patriot.net/~shmuel
We don't care. We don't have to care, we're Congress.
(S877: The Shut up and Eat Your spam act of 2003)

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


Re: Examing Setting Return Codes in a CLIST/MACRO

2013-05-12 Thread esst...@juno.com
Thanks Dave
hats exactly what Im Looking for - After posting I located a publication for 
CLISTs and CLIST Macros.

-- Original Message --
From: Dave Salt ds...@hotmail.com
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Examing  Setting Return Codes in a CLIST/MACRO
Date: Sat, 11 May 2013 17:09:19 -0400

The edit session ends with CANCEL, which means no changes were saved, which 
means ISPF sets the return code of the macro to 4. If you want to end with a 
different return code, you can hard code it like this:

EXIT CODE(0)

Or set it using this as an example:

ISREDIT CHANGE 'XXX' 'V0' ALL   
SET EXITCODE = LASTCC
do more stuff
EXIT CODE(EXITCODE) 

Hope that helps,

Dave Salt

SimpList(tm) - try it; you'll get it! 

http://www.mackinney.com/products/program-development/simplist.html  


 Date: Sat, 11 May 2013 19:44:12 +
 From: esst...@juno.com
 Subject: Examing  Setting Return Codes in a CLIST/MACRO
 To: IBM-MAIN@LISTSERV.UA.EDU
 
 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 XXX. 
 SET IOFUNC  = STR(EDIT)   
 ISPEXEC EDIT DATASET('JCLLIB(CATLOG42)') MACRO(ALTER)
 
 
 The ALTER MACRO Executes/ Changes the VALUE OF XXX 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 XXX 
 ISREDIT CHANGE 'XXX' '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.
 
 Here is the excerpt from the trace:
 SET IOFUNC  = STR(EDIT)
 SET IOFUNC  = EDIT  
 ISPEXEC EDIT DATASET('JCLLIB(CATLOG42)') MACRO(ALTER)  
 ISPEXEC EDIT DATASET('TECH.CICSTS.V42.JCLLIB(CATLOG42)') MACRO(ALTER)   
  IKJ56250I JOB TEC0P0DC(JOB05492) SUBMITTED
  DO
  DO
  SET RC = LASTCC  
  SET RC = 4
 IF RC = 400 THEN
 IF 4 = 400 THEN  
 IF RC NE 0  THEN
 IF 4 NE 0  THEN  
 DO   
 DO   
 WRITE STR(IOFUNC Function Failed RC=RC)   
 WRITE EDIT Function Failed RC=4  
 EDIT Function Failed RC=4
 
 
 Any examples would be appreciated.
 
 
 Thank You In Advance
 Paul D'Angelo   
 --
 For IBM-MAIN subscribe / signoff / archive access instructions,
 send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
  
--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

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


Re: Examing Setting Return Codes in a CLIST/MACRO

2013-05-12 Thread esst...@juno.com
Paul Gilmartin wrote
It appears to be the OP's intent to make changes; submit a job,
and exit the edit session without saving those changes.  Apparently
he considers this normal operation, and prefers a zero return code.

Does your suggestion leave the file unchanged, end the edit session
with RC=0, and not leave the user in a terminal edit session?

(When I wish to be reminded not to save changes, I use View
rather than Edit.  But I don't put the SUBMIT and CANCEL in my
macro because I want to inspect the job before SUBMITting.)

Your point is very well taken, however I did not provide the entire CLIST.
The EDIT is called repeatedly depening on the number of entries in a file.
The Macro sole purpose is to do exactly waht you described.
Ithe JOB being submitted is correct, there are only two statements being 
changed to the Variable passed by the VGET command.
After I SUBMIT The JOB I DO NOt want to preserve the original JCL.

I Am fully aware of the File Tailoring facility, howver in this scenarion
i though this would be a more simpler design.



-- Original Message --
From: Paul Gilmartin paulgboul...@aim.com
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Examing  Setting Return Codes in a CLIST/MACRO
Date: Sat, 11 May 2013 22:04:42 -0500

On Sat, 11 May 2013 17:09:19 -0400, Dave Salt wrote:

The edit session ends with CANCEL, which means no changes were saved, which
means ISPF sets the return code of the macro to 4. If you want to end with a
different return code, you can hard code it like this:

EXIT CODE(0)

Or set it using this as an example:

ISREDIT CHANGE 'XXX' 'V0' ALL   
SET EXITCODE = LASTCC
do more stuff
EXIT CODE(EXITCODE) 

It appears to be the OP's intent to make changes; submit a job,
and exit the edit session without saving those changes.  Apparently
he considers this normal operation, and prefers a zero return code.

Does your suggestion leave the file unchanged, end the edit session
with RC=0, and not leave the user in a terminal edit session?

(When I wish to be reminded not to save changes, I use View
rather than Edit.  But I don't put the SUBMIT and CANCEL in my
macro because I want to inspect the job before SUBMITting.)


 Date: Sat, 11 May 2013 19:44:12 +
 From: essteam
 ...   
 ISREDIT CHANGE 'XXX' 'V0' ALL   
 ISREDIT SUB  
 ISREDIT CAN  
  
 EXIT

-- gil

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

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


Examing Setting Return Codes in a CLIST/MACRO

2013-05-11 Thread esst...@juno.com
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 XXX. 
SET IOFUNC  = STR(EDIT)   
ISPEXEC EDIT DATASET('JCLLIB(CATLOG42)') MACRO(ALTER)


The ALTER MACRO Executes/ Changes the VALUE OF XXX 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 XXX 
ISREDIT CHANGE 'XXX' '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.

Here is the excerpt from the trace:
SET IOFUNC  = STR(EDIT)
SET IOFUNC  = EDIT  
ISPEXEC EDIT DATASET('JCLLIB(CATLOG42)') MACRO(ALTER)  
ISPEXEC EDIT DATASET('TECH.CICSTS.V42.JCLLIB(CATLOG42)') MACRO(ALTER)   
 IKJ56250I JOB TEC0P0DC(JOB05492) SUBMITTED
 DO
 DO
 SET RC = LASTCC  
 SET RC = 4
IF RC = 400 THEN
IF 4 = 400 THEN  
IF RC NE 0  THEN
IF 4 NE 0  THEN  
DO   
DO   
WRITE STR(IOFUNC Function Failed RC=RC)   
WRITE EDIT Function Failed RC=4  
EDIT Function Failed RC=4


Any examples would be appreciated.


Thank You In Advance
Paul D'Angelo   
--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Examing Setting Return Codes in a CLIST/MACRO

2013-05-11 Thread Dave Salt
The edit session ends with CANCEL, which means no changes were saved, which 
means ISPF sets the return code of the macro to 4. If you want to end with a 
different return code, you can hard code it like this:

EXIT CODE(0)

Or set it using this as an example:

ISREDIT CHANGE 'XXX' 'V0' ALL   
SET EXITCODE = LASTCC
do more stuff
EXIT CODE(EXITCODE) 

Hope that helps,

Dave Salt

SimpList(tm) - try it; you'll get it! 

http://www.mackinney.com/products/program-development/simplist.html  


 Date: Sat, 11 May 2013 19:44:12 +
 From: esst...@juno.com
 Subject: Examing  Setting Return Codes in a CLIST/MACRO
 To: IBM-MAIN@LISTSERV.UA.EDU
 
 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 XXX. 
 SET IOFUNC  = STR(EDIT)   
 ISPEXEC EDIT DATASET('JCLLIB(CATLOG42)') MACRO(ALTER)
 
 
 The ALTER MACRO Executes/ Changes the VALUE OF XXX 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 XXX 
 ISREDIT CHANGE 'XXX' '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.
 
 Here is the excerpt from the trace:
 SET IOFUNC  = STR(EDIT)
 SET IOFUNC  = EDIT  
 ISPEXEC EDIT DATASET('JCLLIB(CATLOG42)') MACRO(ALTER)  
 ISPEXEC EDIT DATASET('TECH.CICSTS.V42.JCLLIB(CATLOG42)') MACRO(ALTER)   
  IKJ56250I JOB TEC0P0DC(JOB05492) SUBMITTED
  DO
  DO
  SET RC = LASTCC  
  SET RC = 4
 IF RC = 400 THEN
 IF 4 = 400 THEN  
 IF RC NE 0  THEN
 IF 4 NE 0  THEN  
 DO   
 DO   
 WRITE STR(IOFUNC Function Failed RC=RC)   
 WRITE EDIT Function Failed RC=4  
 EDIT Function Failed RC=4
 
 
 Any examples would be appreciated.
 
 
 Thank You In Advance
 Paul D'Angelo   
 --
 For IBM-MAIN subscribe / signoff / archive access instructions,
 send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
  
--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Examing Setting Return Codes in a CLIST/MACRO

2013-05-11 Thread retired mainframer
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 XXX.
:: SET IOFUNC  = STR(EDIT)
:: ISPEXEC EDIT DATASET('JCLLIB(CATLOG42)') MACRO(ALTER)
::
::
:: The ALTER MACRO Executes/ Changes the VALUE OF XXX 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 XXX
:: ISREDIT CHANGE 'XXX' '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


Re: Examing Setting Return Codes in a CLIST/MACRO

2013-05-11 Thread Paul Gilmartin
On Sat, 11 May 2013 17:09:19 -0400, Dave Salt wrote:

The edit session ends with CANCEL, which means no changes were saved, which
means ISPF sets the return code of the macro to 4. If you want to end with a
different return code, you can hard code it like this:

EXIT CODE(0)

Or set it using this as an example:

ISREDIT CHANGE 'XXX' 'V0' ALL   
SET EXITCODE = LASTCC
do more stuff
EXIT CODE(EXITCODE) 

It appears to be the OP's intent to make changes; submit a job,
and exit the edit session without saving those changes.  Apparently
he considers this normal operation, and prefers a zero return code.

Does your suggestion leave the file unchanged, end the edit session
with RC=0, and not leave the user in a terminal edit session?

(When I wish to be reminded not to save changes, I use View
rather than Edit.  But I don't put the SUBMIT and CANCEL in my
macro because I want to inspect the job before SUBMITting.)


 Date: Sat, 11 May 2013 19:44:12 +
 From: essteam
 ...   
 ISREDIT CHANGE 'XXX' 'V0' ALL   
 ISREDIT SUB  
 ISREDIT CAN  
  
 EXIT

-- gil

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


Re: Examing Setting Return Codes in a CLIST/MACRO

2013-05-11 Thread Dave Salt
 Does your suggestion leave the file unchanged, end the edit session
 with RC=0, and not leave the user in a terminal edit session?

The edit session would end with whatever return code was set by CHANGE. For 
example, if the change was successful (RC=0, which means one or more strings 
were changed), then yes the edit session would end without the changes being 
saved and using exit code zero.

 (When I wish to be reminded not to save changes, I use View rather than Edit. 

The OP obviously wants to make sure no permanent changes are made. Based on 
that, I agree with you it would be much better to call the macro using VIEW 
instead of EDIT. 

Dave Salt

SimpList(tm) - try it; you'll get it! 

http://www.mackinney.com/products/program-development/simplist.html  


 Date: Sat, 11 May 2013 22:04:42 -0500
 From: paulgboul...@aim.com
 Subject: Re: Examing  Setting Return Codes in a CLIST/MACRO
 To: IBM-MAIN@LISTSERV.UA.EDU
 
 On Sat, 11 May 2013 17:09:19 -0400, Dave Salt wrote:
 
 The edit session ends with CANCEL, which means no changes were saved, which
 means ISPF sets the return code of the macro to 4. If you want to end with a
 different return code, you can hard code it like this:
 
 EXIT CODE(0)
 
 Or set it using this as an example:
 
 ISREDIT CHANGE 'XXX' 'V0' ALL   
 SET EXITCODE = LASTCC
 do more stuff
 EXIT CODE(EXITCODE) 
 
 It appears to be the OP's intent to make changes; submit a job,
 and exit the edit session without saving those changes.  Apparently
 he considers this normal operation, and prefers a zero return code.
 
 Does your suggestion leave the file unchanged, end the edit session
 with RC=0, and not leave the user in a terminal edit session?
 
 (When I wish to be reminded not to save changes, I use View
 rather than Edit.  But I don't put the SUBMIT and CANCEL in my
 macro because I want to inspect the job before SUBMITting.)
 
 
  Date: Sat, 11 May 2013 19:44:12 +
  From: essteam
  ...   
  ISREDIT CHANGE 'XXX' 'V0' ALL   
  ISREDIT SUB  
  ISREDIT CAN  
   
  EXIT
 
 -- gil
 
 --
 For IBM-MAIN subscribe / signoff / archive access instructions,
 send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
  
--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN