Page 1 of 1

Passing values from program to JCL

PostPosted: Tue Feb 21, 2012 7:55 pm
by sugavanesh
How to pass values from a program to JCL ? ......

Re: Passing values from REXX to JCL

PostPosted: Tue Feb 21, 2012 8:28 pm
by Akatsukami
File tailoring.

Re: Passing values from REXX to JCL

PostPosted: Tue Feb 21, 2012 9:30 pm
by enrico-sorichetti
there are quite a few examples on this forum
and also on http://www.ibmmainframes.com/index.php
on how to build jcl using both plain REXX or REXX and ISPF

for REXX/ISPF both the coding and the maintenance are much simpler

Re: Passing values from program to JCL

PostPosted: Tue Feb 21, 2012 10:58 pm
by steve-myers
sugavanesh wrote:How to pass values from a program to JCL ? ......
We've been through this before but ...

the only value a program can supply to JCL that can be used by JCL is a return code. And the only way JCL can use a return code is in evaluating an EXEC statement or JOB statement COND parameter, or in a // IF statement.

Re: Passing values from program to JCL

PostPosted: Wed Feb 22, 2012 2:02 am
by NicC
Please give an example of what you mean. Akatsukami and Enrico understand one thing Steve and I understand another thing. Remember that by the time your job runs the JCL has been interpreted and it is the interpreted information that is used when the job runs.

Re: Passing values from program to JCL

PostPosted: Wed Feb 22, 2012 6:27 am
by steve-myers
NicC is correct: your initial subject read "How can I pass a value from a program being run by JCL to influence the remainder of the JCL?" Well, that's how I read it, anyway. Other people read it as, "How can I insert a value (or values) into JCL being submitted for another job?" This is a whole different thing: you just have to alter the JCL text before submitting it, and there are many, many ways to do this. From the early days of OS/360 through early MVS releases the system programmer prepared a system description using Assembler macro calls, and then ran this description through the Assembler. The output from this assembly was a very large job that used the Assembler, linkage editor and other system utility programs to create the system libraries. Regardless of methods, the final result was identical to what you propose. At various times in my career I used the exact same technique to generate JCL.