Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Change the return of a single step in a JCL

3,977 views
Skip to first unread message

Zhi Ying Chen

unread,
Sep 27, 2008, 9:07:59 AM9/27/08
to
Hi,Folks

I'm demanded to give a solution on control the return code in the JCL

The following is the structure of the JCL

//step1 exe porgram1

//step2 exe program2

//step3 exe program3 cond=(4,LT)


Since the Step1 and step2 could run in despite of the return code.
I want to reset their return code after the step is executed.

e.g.

Run step1-->failed,rc=12
Run step2-->sucess,rc=0
if step2.rc = 0 then set the return code of step1 = 0

Don't if there is any solution.

PS:i searched the internet, there is some articles mentioned about using
IDCAMS, but i think that is used only for the allocation of empty dataset
only.

==>Ciger.Chen<==
==>Telephone<==
0411-81913631
//
//MYWALLET EXEC PGM=SPOUSE
//SYSIN DD DSN=MYWALLET.ALL,DISP=SHR
//SYSOUT DD DUMMY

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX

Lizette Koehler

unread,
Sep 27, 2008, 9:32:09 AM9/27/08
to
This question could be posted to IBM-MAIN for general JCL coding practices.

For IBM-MAIN subscribe / signoff / archive access instructions, send email
to list...@bama.ua.edu with the message: GET IBM-MAIN INFO Search the
archives at http://bama.ua.edu/archives/ibm-main.html

If step1 or step2 set return code other than 0 (zero) then you could use IF
ENDIF statements in JCL.

//STEP1 EXEC PGM=RTN
.
.
//IFBAD IF (ABEND | STEP1.RC > 8) THEN
//TRUE EXEC PROC=ERROR
//IFBADEND ENDIF
//NEXTSTEP EXEC PROC=CONTINUE

Or code

//STEP1 EXEC PGM=PGM1
//STEP2 EXEC PGM=PGM2,COND=(STEP1,LT,12)
//STEP3 EXEC PGM=PGM3,COND=((STEP1,LT,12),STEP2,LT,20))

JCL Users guide will explain this information.

Lizette

>
> I'm demanded to give a solution on control the return code in the JCL
>
> The following is the structure of the JCL
>
> //step1 exe porgram1
>
> //step2 exe program2
>
> //step3 exe program3 cond=(4,LT)
>
>
> Since the Step1 and step2 could run in despite of the return code.
> I want to reset their return code after the step is executed.
>
> e.g.
>
> Run step1-->failed,rc=12
> Run step2-->sucess,rc=0
> if step2.rc = 0 then set the return code of step1 = 0
>
> Don't if there is any solution.

----------------------------------------------------------------------

Frank Clarke

unread,
Sep 27, 2008, 1:39:32 PM9/27/08
to

Someone from IBM.COM is asking --us-- about JCL ???? ???? Does JCL FORUM no
longer exist? Or has IBM separated all who might have been contributors?

On 27 Sep 2008 06:07:59 -0700, zhiy...@CN.IBM.COM (Zhi Ying Chen) wrote:
<OF6F3703E1.A1DE1205-ON482574...@cn.ibm.com>

>Hi,Folks
>
>I'm demanded to give a solution on control the return code in the JCL
>
>The following is the structure of the JCL
>
>//step1 exe porgram1
>
>//step2 exe program2
>
>//step3 exe program3 cond=(4,LT)
>
>
>Since the Step1 and step2 could run in despite of the return code.
>I want to reset their return code after the step is executed.
>
>e.g.
>
>Run step1-->failed,rc=12
>Run step2-->sucess,rc=0
>if step2.rc = 0 then set the return code of step1 = 0
>
>Don't if there is any solution.
>
>PS:i searched the internet, there is some articles mentioned about using
>IDCAMS, but i think that is used only for the allocation of empty dataset
>only.
>

(change Arabic number to Roman numeral to email)

John McKown

unread,
Sep 27, 2008, 3:10:46 PM9/27/08
to
On Sat, 27 Sep 2008, Zhi Ying Chen wrote:

> Hi,Folks
>
> I'm demanded to give a solution on control the return code in the JCL
>
> The following is the structure of the JCL
>
> //step1 exe porgram1
> //step2 exe program2
> //step3 exe program3 cond=(4,LT)
>
> Since the Step1 and step2 could run in despite of the return code.
> I want to reset their return code after the step is executed.
>
> e.g.
>
> Run step1-->failed,rc=12
> Run step2-->sucess,rc=0
> if step2.rc = 0 then set the return code of step1 = 0
>
> Don't if there is any solution.
>
> PS:i searched the internet, there is some articles mentioned about using
> IDCAMS, but i think that is used only for the allocation of empty dataset
> only.
>

There is no way to do exactly what you want. The RC of a step is set when
the step ends. There is no documented way to change it. Now, if you're an
internals expert, you might be able to track down the memory resident
control block which contains the RC and change it. But even if you figure
out how to do it now, it might not work in a future release of z/OS.

If this sort of thing is really needed, then IBM will need to be informed
and asked to implement a standard way to do it. Of course, this is a bit
of a pain <grin>.

--
Q: What do theoretical physicists drink beer from?
A: Ein Stein.

Maranatha!
John McKown

James Campbell

unread,
Sep 28, 2008, 4:11:32 AM9/28/08
to
If you push the execution of the programs into a REXX EXEC this this becomes easy. If you
want to do it in JCL, I think JOL (which is really a front end on JCL) is the only way.

http://members.ozemail.com.au/~oscarptyltd/oscar_jol_desc.html

But it does depend on what you are -actually- trying to achieve.

James Campbell

> ----------------------------------------------------------------------
>
> Date: Sat, 27 Sep 2008 21:03:05 +0800
> From: Zhi Ying Chen <zhiy...@CN.IBM.COM>
> Subject: Change the return of a single step in a JCL


>
> Hi,Folks
>
> I'm demanded to give a solution on control the return code in the JCL
>
> The following is the structure of the JCL
>
> //step1 exe porgram1
>
> //step2 exe program2
>
> //step3 exe program3 cond=(4,LT)
>
>
> Since the Step1 and step2 could run in despite of the return code.
> I want to reset their return code after the step is executed.
>
> e.g.
>
> Run step1-->failed,rc=12
> Run step2-->sucess,rc=0
> if step2.rc = 0 then set the return code of step1 = 0
>
> Don't if there is any solution.
>
> PS:i searched the internet, there is some articles mentioned about using
> IDCAMS, but i think that is used only for the allocation of empty dataset
> only.
>
>

----------------------------------------------------------------------

Hamilton, Robert L

unread,
Sep 28, 2008, 11:58:30 AM9/28/08
to
I don't understand the need to change a return code of a step after it
has completed. What purpose would it serve if you could 'change' it?

bobh

Robert Zenuk

unread,
Sep 28, 2008, 1:19:20 PM9/28/08
to
This is actually better suited for IBM-MAIN.

Your comment about IDCAMS leads me to believe STEP 1 is an IDCAMS step. If
you always want CC=0 from an IDCAMS step you can SET MAXCC = 0 in the IDCAMS
control statements (DEFINE, ALTER, DELETE, whatever). This will force the
step to CC=0 in all cases.

_http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/dgt2i251/2.4.1?ACT
ION=MATCHES&REQUEST=set+maxcc&TYPE=FUZZY&SHELF=DGT2BK61&DT=20070124224148&CASE
=&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK&ScrollTOP=FIRS
THIT#FIRSTHIT_
(http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/dgt2i251/2.4.1?ACTION=MATCHES&REQUEST=set+maxcc&TYPE=FUZZY&SHELF=DGT2BK61&DT=2007
0124224148&CASE=&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK
&ScrollTOP=FIRSTHIT#FIRSTHIT)

Here is an example that keeps CC=0 after a DELETE failure (when MY.CLUSTER
does not exist).

//DEFCLUST EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE 'MY.CLUSTER'
SET MAXCC = 0
DEFINE CLUSTER -
(NAME(MY.CLUSTER) -
SHR(2,3) -
CYL(1,1) -
KEY(10 0) -
RECSZ(80 80) -
CISZ(16384))

As for return code management in JCL after a step completes, I don't believe
you can do anything about that. The old COND= parm is difficult and
confusing (even for veterans). I always have to think about it and the old saying
"if the condition is true, fall through" helps, but you still have to think
about every step. A while back (10+ years?) IBM added the JCL IF statement.
This was a huge improvement and should be used when you want to have better
control over step processing.

_http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA2B661/17.0?SHEL
F=IEA2BK71&DT=20060125042105_
(http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA2B661/17.0?SHELF=IEA2BK71&DT=20060125042105)

Hope This Helps,

Rob

In a message dated 9/27/2008 6:08:07 A.M. US Mountain Standard Time,
zhiy...@CN.IBM.COM writes:

Hi,Folks

I'm demanded to give a solution on control the return code in the JCL

The following is the structure of the JCL

//step1 exe porgram1

//step2 exe program2

//step3 exe program3 cond=(4,LT)


Since the Step1 and step2 could run in despite of the return code.
I want to reset their return code after the step is executed.

e.g.

Run step1-->failed,rc=12
Run step2-->sucess,rc=0
if step2.rc = 0 then set the return code of step1 = 0

Don't if there is any solution.

PS:i searched the internet, there is some articles mentioned about using
IDCAMS, but i think that is used only for the allocation of empty dataset
only.

==>Ciger.Chen<==


==>Telephone<==
0411-81913631
//
//MYWALLET EXEC PGM=SPOUSE
//SYSIN DD DSN=MYWALLET.ALL,DISP=SHR
//SYSOUT DD DUMMY

----------------------------------------------------------------------


For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX

**************Looking for simple solutions to your real-life financial
challenges? Check out WalletPop for the latest news and information, tips and
calculators. (http://www.walletpop.com/?NCID=emlcntuswall00000001)

Zhi Ying Chen

unread,
Sep 28, 2008, 8:18:28 PM9/28/08
to
Hi,Robert.
The reason for setting is that we want to use LISTDS to recall datasets
from HSM once they were recalled so that we can backup them using ADRDSSU
utility
Since once the dataset is missing, the LISTDS will return a return code 12.
However, this situation is more complex when we use Tivoli Workload
Schedulor to run the JCls :"(
Since a return code 12 will be considered as error in TWS.however it
isn't...

So, i am trying to find some way to control the return code.
Maybe rexx can handle this?
My plan is to use rexx to call the listds to recall them and we can catch
the return code as an argument .


==>Ciger.Chen<==
==>Telephone<==
0411-81913631
//
//MYWALLET EXEC PGM=SPOUSE
//SYSIN DD DSN=MYWALLET.ALL,DISP=SHR
//SYSOUT DD DUMMY

"Hamilton, Robert L" <rob...@UTDALLAS.EDU>
Sent by: TSO REXX Discussion List <TSO-...@VM.MARIST.EDU>
09/28/2008 11:58 PM
Please respond to
TSO REXX Discussion List <TSO-...@VM.MARIST.EDU>

To
TSO-...@VM.MARIST.EDU
cc

Subject
Re: [TSO-REXX] Change the return of a single step in a JCL


I don't understand the need to change a return code of a step after it
has completed. What purpose would it serve if you could 'change' it?

bobh


> Date: Sat, 27 Sep 2008 21:03:05 +0800
> From: Zhi Ying Chen <zhiy...@CN.IBM.COM>
> Subject: Change the return of a single step in a JCL
>

> Hi,Folks
>
> I'm demanded to give a solution on control the return code in the JCL
>
> The following is the structure of the JCL
>
> //step1 exe porgram1
>
> //step2 exe program2
>
> //step3 exe program3 cond=(4,LT)
>
>
> Since the Step1 and step2 could run in despite of the return code.
> I want to reset their return code after the step is executed.
>
> e.g.
>
> Run step1-->failed,rc=12
> Run step2-->sucess,rc=0
> if step2.rc = 0 then set the return code of step1 = 0
>
> Don't if there is any solution.
>
> PS:i searched the internet, there is some articles mentioned about
using
> IDCAMS, but i think that is used only for the allocation of empty
dataset
> only.
>
>

----------------------------------------------------------------------

Lizette Koehler

unread,
Sep 28, 2008, 9:04:58 PM9/28/08
to
I guess I am confused as to why spend all those system resources to recall
datasets that were migrated. That will require that they get migrated again
unless you have a lot of dasd in the shop to do this.

I know that if a data set is migrated, then DFDSS does not recall it. But
my brain is thinking that there is a way to get the migrated data to another
DFDSS DR tape. Of course I am guessing this is being done for DR purposes.

And if it is, does that mean you are not taking your HSM migration, dump or
backup tapes to DR?

Do you use ABARS for backup/recovery of application data?


Just some questions.

Lizette

Robert Zenuk

unread,
Sep 28, 2008, 10:50:20 PM9/28/08
to
I am confused why you would use LISTDS to recall datasets. A simple IEFBR14
can be used to recall datasets. Just add a DD for every cataloged dataset
you want to recall and backup. With IEFBR14 there is no return code
consideration.

However, I agree with Lizette, why would you recall something to back it up?
This is the stuff ABARS is designed for. ABARS can backup datasets on DASD
or a dataset on ML1 or ML2 (without recalling them).

If you are going to write a REXX EXEC, code an HRECALL with WAIT and
EXTENDRC for each dataset and/or valid dataset patterns.

Rob


In a message dated 9/28/2008 6:05:02 P.M. US Mountain Standard Time,
star...@MINDSPRING.COM writes:


Just some questions.

Lizette

**************Looking for simple solutions to your real-life financial


challenges? Check out WalletPop for the latest news and information, tips and
calculators. (http://www.walletpop.com/?NCID=emlcntuswall00000001)

----------------------------------------------------------------------

James Campbell

unread,
Sep 29, 2008, 6:06:57 AM9/29/08
to
Yes some simple REXX is the way to go.

However in a situation like this I go for two sets of HRECALLs
- first time I hrecall all the datasets with NOWAIT
- second time I hrecall all the daatsets with WAIT.

The reason is that HSM knows what it has to recall, and if there are several datasets on a
tape it can recall all the datasets from that tape - without getting side tracked by demounting
and remounting volumes.

The real wait is on the second pass. If there are any problems they'll be reported in the
extendrc.

James Campbell


> ------------------------------
>
> Date: Sun, 28 Sep 2008 22:49:51 EDT
> From: Robert Zenuk <Robz...@AOL.COM>
> Subject: Re: Change the return of a single step in a JCL


>
> I am confused why you would use LISTDS to recall datasets. A simple IEFBR14
> can be used to recall datasets. Just add a DD for every cataloged dataset
> you want to recall and backup. With IEFBR14 there is no return code
> consideration.
>
> However, I agree with Lizette, why would you recall something to back it up?
> This is the stuff ABARS is designed for. ABARS can backup datasets on DASD
> or a dataset on ML1 or ML2 (without recalling them).
>
> If you are going to write a REXX EXEC, code an HRECALL with WAIT and
> EXTENDRC for each dataset and/or valid dataset patterns.
>
> Rob
>

----------------------------------------------------------------------

Captain Paralytic

unread,
Sep 29, 2008, 6:56:34 AM9/29/08
to
On 29 Sep, 01:18, zhiyi...@CN.IBM.COM (Zhi Ying Chen) wrote:
> Hi,Robert.
> The reason for setting is that we want to use LISTDS to recall datasets
> from HSM once they were recalled so that we can backup them using ADRDSSU
> utility
> Since once the dataset is missing, the LISTDS will return a return code 12.
> However, this situation is more complex when we use Tivoli Workload
> Schedulor to run the JCls :"(
> Since a return code 12 will be considered as error in TWS.however it
> isn't...
TWS has an option that can set which RC is taken as the RC of a job.
The options are higest or last. Seems like you just need it set to
last.

Alternatively you can use TWS's automatic recovery operations to
successfully complete the job.

Either way, there is no need to muck around with the step completion
codes.

Lizette Koehler

unread,
Sep 29, 2008, 8:18:06 AM9/29/08
to
With Robert's suggestion of an IEFBR14 the step will not end until all
Datasets are recalled, one at a time. So depending on how many datasets
need to be recalled and how long you expect the job to run, there may be
other ways to do this.


Do you need for the recalls to complete before going on to the next step?
How long do you expect this process to take to recall datasets?


I would also add that if you have a large number of datasets to recall the
best way to do it would be to do them in a group. If you issue them as you
find them, then DFHSM will be constantly issue MOUNT, RECALL, Unmount,
Mount, Recall, Unmount, for all migrated volumes. By grouping the dataset
by ML2 volume you get - Mount, RECALL, RECALL, ... RECALL, Unmount, Mount,
Recall, Recall,..., Unmount.

So if you have 100 datasets you need to list which ML2 tape they are on,
then issue the HRECALLS to one tape group at a time. So if 15 datasets are
on ML2VOL1 then I would issue those 15 first, another 21 are on ML2VOL2 then
issue that set of recalls, and so forth.

That way DFHSM will not be mounting the same tape multiple times and it will
speed up the recall process.


Lizette

> I am confused why you would use LISTDS to recall datasets. A simple
> IEFBR14
> can be used to recall datasets. Just add a DD for every cataloged
> dataset
> you want to recall and backup. With IEFBR14 there is no return code
> consideration.
>
> However, I agree with Lizette, why would you recall something to back
> it up?
> This is the stuff ABARS is designed for. ABARS can backup datasets
> on DASD
> or a dataset on ML1 or ML2 (without recalling them).
>
> If you are going to write a REXX EXEC, code an HRECALL with WAIT and
> EXTENDRC for each dataset and/or valid dataset patterns.
>

----------------------------------------------------------------------

Bob Bridges

unread,
Sep 29, 2008, 2:12:14 PM9/29/08
to
Setting aside everyone else's questions about your ultimate goal, and
focusing on your actual question, in my opinion your best option isn't to
try to override the RC returned by one step. Instead, just change the
circumstances under which step3 will run. For example, if you want to run
step3 even if step1 is >12, but you want to skip step3 if step2 is >4, then
do it this way:

//STEP3 EXE PROGRAM3 COND=(12,LT,STEP1,4,LT,STEP2)

Someone else posted this earlier so I didn't mention it, but as the
conversation seems to be running on regardless, maybe it's worth repeating.

---
Bob Bridges, rhb...@attglobal.net
cell 336 382-7313

/* "All's fair in love and war" -- what a contemptible lie! -Lazarus Long
*/

-----Original Message-----
From: Zhi Ying Chen
Sent: Sunday, September 28, 2008 20:14

The reason for setting is that we want to use LISTDS to recall datasets
from HSM once they were recalled so that we can backup them using ADRDSSU

utility / Since once the dataset is missing, the LISTDS will return a


return code 12. However, this situation is more complex when we use Tivoli

Workload Schedulor to run the JCls :"(Since a return code 12 will be


considered as error in TWS.however it isn't...

--- "Hamilton, Robert L" <rob...@UTDALLAS.EDU>, 09/28/2008 11:58 PM


I don't understand the need to change a return code of a step after it
has completed. What purpose would it serve if you could 'change' it?

-----Original Message-----
From: Zhi Ying Chen
Sent: Saturday, September 27, 2008 09:03

I'm demanded to give a solution on control the return code in the JCL
The following is the structure of the JCL

//step1 exe porgram1
//step2 exe program2
//step3 exe program3 cond=(4,LT)

Since the Step1 and step2 could run in despite of the return code.
I want to reset their return code after the step is executed.

e.g.

Run step1-->failed,rc=12
Run step2-->sucess,rc=0

if step2.rc = 0 then set the return code of step1 = 0

----------------------------------------------------------------------

0 new messages