Page 1 of 1

passing parameters from REXX to JCL

PostPosted: Wed Nov 23, 2011 10:25 pm
by learning_ibm
Hello,
I have a REXX which creates a jcl. This jcl executes a cobol program which creates another JCL(shown below) and submits it.

//SORTXX ...
....
/*ROUTE XEQ DD
//SORTSTEP EXEC PGM=SORT
//SORTIN DD DSN=xxx.yyy.zzz.DATA,
// DISP=SHR
//SORTOUT DD DSN=xxx.yyy.zzz.data.extract,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(10,50),RLSE)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(143,007,EQ,4235534)
//INTRD01 EXEC PGM=IEBGENER,COND=(4,LT)
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSUT1 DD DISP=SHR,DSN=xxxx.yyyy.zzzz.JCL(NDM1)
//SYSUT2 DD SYSOUT=(1,INTRDR)
//SYSIN DD DUMMY

The above JCL will submit another JCL in xxxx.yyyy.zzzz.JCL(NDM1)


//NDM1 ....
...
//S09 EXEC PGM=utility,
// PARM='&SYSUID,BA,CYCL'
//*
//INDD DD DSN=ABCD.CTC(NDM1CTC),
// DISP=SHR
//OUTDD DD DSN=&&NDMDATA,
// DISP=(NEW,PASS),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=1680),
// SPACE=(TRK,(1,1)),
// UNIT=SYSALLDA
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//*

Now, This 'CYCL' is accepted from REXX and is used in NDM1 job to create control card NDM1CTC.

I need to pass the value from REXX to NDM1 job as a paramter. As per my knowledge, I cannot pass CYCL from INTRD01 step to the next JCL(NDM1).

Please suggest.

Re: passing parameters from REXX to JCL

PostPosted: Wed Nov 23, 2011 10:53 pm
by Akatsukami
learning_ibm wrote:Hello,
I have a REXX which creates a jcl. This jcl executes a cobol program which creates another JCL(shown below) and submits it. [...]
Now, This 'CYCL' is accepted from REXX and is used in NDM1 job to create control card NDM1CTC.

I need to pass the value from REXX to NDM1 job as a paramter. As per my knowledge, I cannot pass CYCL from INTRD01 step to the next JCL(NDM1).

Please suggest.

First, I suggest that you enclose code, JCL, etc. -- anything where indentation and formatting are important and must be preserved -- in Code tags.

Now, if I understand you: your exec -- for the sake of discussion, let us call it E1 -- creates a job (not a "JCL", please) something like:
//J1       JOB   etc.
//STEP0001 EXEC PGM=C1 <--- This is a COBOL program
//STEPLIB  DD   DSN=MY.LOAD.LIB,DISP=SHR
//NEXTJOB  DD   SYSOUT=(B,,INTRDR)

C1 creates the JCL that you show above.

Why not modify the program C1 slightly and have the exec generate JCL like:
//J1A      JOB   etc.
//STEP0001 EXEC PGM=C1A,PARM='CYCL'
//STEPLIB  DD   DSN=MY.LOAD.LIB,DISP=SHR
//NEXTJOB  DD   SYSOUT=(B,,INTRDR)

and pass CYCL (I assume that you mean a literal "CYCL" and not the value of a variable CYCL) into the program that way?

Re: passing parameters from REXX to JCL

PostPosted: Thu Nov 24, 2011 12:50 pm
by learning_ibm
E1 REXX creates a JOB J1 and submits it.
//J1 JOB etc.
//STEP0001 EXEC PGM=C1 <--- This is a COBOL program
//STEPLIB DD DSN=MY.LOAD.LIB,DISP=SHR
//PARM DD DSN=A.PARM,DISP=SHR
//DATA DD DSN=A.DATA,DISP=SHR
//OUTPT DD DSN=A.OUT.JCL,DISP=(NEW,CTLG,CTLG)
...
//

Now C1 creates a job(SORTXX) in output file(A.OUT.JCL) depending upon the input in data file and PARM file.( PARM FILE contains value of CYCL variable.)
SORTXX submits another job xxxx.yyyy.zzzz.JCL(NDM1).

I need value of vaariable CYCL in
//NDM1 ....
...
//S09 EXEC PGM=utility,
// PARM='&SYSUID,BA,CYCL

NDM1 job uses an internal utility to create control card NDM1CTC such that If I pass &sysid,ba,cycl parameters to this utility, it will create DSN "&SYSUID..BA.CYCL".(so for each different "cycl", I need to create different DSN and put data into it)
I could take the CYCL variable from REXX to SORT job but not able to find how to pass value of this variable from SORT job to NDM1.

Re: passing parameters from REXX to JCL

PostPosted: Thu Nov 24, 2011 5:53 pm
by NicC
You were asked to put further JCL/code in code tags. You didn't. So, if you ignore requests from those trying to help, why should they help you? If you have the Quick Reply area then the code tag button is not visible but with a little thought, and looking, you could easily click on the Full Editor button where you would find...the full editor including many buttons to help you format your post.

Re: passing parameters from REXX to JCL

PostPosted: Fri Nov 25, 2011 11:21 am
by dick scherrer
Hello,

In addition to not following directions from people who would help, learning has the mis-guided beliefe that it is ok to multi-post across different forums :(

I'll watch for a little while (day or 2) and will probably start deleting clutter.