passing parameters from REXX to JCL



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

passing parameters from REXX to JCL

Postby learning_ibm » Wed Nov 23, 2011 10:25 pm

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.
learning_ibm
 
Posts: 4
Joined: Wed Nov 23, 2011 8:14 pm
Has thanked: 0 time
Been thanked: 0 time

Re: passing parameters from REXX to JCL

 

Re: passing parameters from REXX to JCL

Postby Akatsukami » Wed Nov 23, 2011 10:53 pm

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?
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1053
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: passing parameters from REXX to JCL

Postby learning_ibm » Thu Nov 24, 2011 12:50 pm

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.
learning_ibm
 
Posts: 4
Joined: Wed Nov 23, 2011 8:14 pm
Has thanked: 0 time
Been thanked: 0 time

Re: passing parameters from REXX to JCL

Postby NicC » Thu Nov 24, 2011 5:53 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: passing parameters from REXX to JCL

Postby dick scherrer » Fri Nov 25, 2011 11:21 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post