Page 1 of 1

Pass parameters in from REXX to JCL

PostPosted: Sat Apr 17, 2010 9:22 pm
by meowmeow
hi everyone,
could someone help me how to pass values from rexx to jcl?
its hard following the concept in manuals i have found...
here's what i got.

//EDITJCLB JOB
//*******************************************
//STEP1 EXEC PGM=FILEAID
//************************************************
//SYSPRINT DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//DD01 DD DSN='my.dataset',
// DISP=(OLD,KEEP)
//SYSIN DD *
$$DD01 UPDATE IF=(1,EQ,C'ABC'),REPL=(1,C'CDE')

**can the DD01 be a variable whose value would be passed by the REXX program?
**can the parameters for the UPDATE IF part for the one to be changed and what to be replaced be a variable whose value is also from the rexx program..

REXX PROGRAM:
Variables above would depend on this rexx code:
varDSN='my,dataset’
varCHG=’data to be change’
varNEW=’new data’
ADDRESS TSO
"SUBMIT 'REXX.PGM(EDITJCLB)'"

Re: Pass parameters in from REXX to JCL

PostPosted: Sun Apr 18, 2010 2:22 am
by MrSpock
I don't quite understand what you're asking. If you plan to write a REXX exec that will be used to create and then submit a job, then the answer to both of your questions is obviously yes, since the content of that job can be anything. Or, the exec can obviously write to members of a PARMLIB, or some other dataset, that can be used by a subsequent job. Or you could use ISPF File Tailoring skeleton's to create JCL templates.

Re: Pass parameters in from REXX to JCL

PostPosted: Sun Apr 18, 2010 7:07 am
by dick scherrer
Hello,

Suggst you talk with someone responsible for this as to the acceptability of over-writing not only one file but many of them. If most organizatons, it is unacceptable to use this kind of process for Production data.

If something is to be done "on the fly", the original file should be renamed and then copied back to the original name so that the original data is protected.

There is also the data auditability issue. Someone may need to see the data before the change and over-writing the file loses this capability.

Re: Pass parameters in from REXX to JCL

PostPosted: Mon Apr 19, 2010 2:57 pm
by Bala1
Hi ,

If in rexx you are using the variable varDSN to pull the name for the data set , then all you need to do in JCL is to use &varDSN.

i.e,
//DD01 DD DSN= &varDSN.,


Hope this helps you...

Re: Pass parameters in from REXX to JCL

PostPosted: Mon Apr 19, 2010 4:37 pm
by expat
Bala1 wrote:Hi ,

If in rexx you are using the variable varDSN to pull the name for the data set , then all you need to do in JCL is to use &varDSN.

i.e,
//DD01 DD DSN= &varDSN.,

Hope this helps you...


Would you care to provide working proof of this.

Re: Pass parameters in from REXX to JCL

PostPosted: Mon Apr 19, 2010 5:41 pm
by Bala1
Hi EXPAT,
I am new to this forum and Please find the screen shots attached on how the values would have been populated in JCL . I had just provided the logic and wasnt aware that i need to code and give the solution.


Let me know if this helped or you require the actual working code...

Re: Pass parameters in from REXX to JCL

PostPosted: Tue Apr 20, 2010 12:02 am
by dick scherrer
Hello,

Please do not attach "screenshots". To post what is on a 3270-screen, simply copy/paste form the terminal to the reply and then use the "Code" tag (which will preserve alignment and improve readability). Many people are not permitted to download attachments for security reasons in their organization. As hard as it may be to believe, not everyone has Microsoft Office. . .

When using the Code tag, also use Preview so you can see your post as it will appear to the forum (rather than how it appears in the Reply Editor).

I had just provided the logic and wasnt aware that i need to code and give the solution.
It is always most helpful if a suggestion/solution is accompanied with the actual code/jcl and the output from a successful execution.

Re: Pass parameters in from REXX to JCL

PostPosted: Wed Apr 21, 2010 2:16 am
by Pedro
Would you care to provide working proof of this.

Bala, I think Expat's point was that your 'logic' will not work. You cannot write 'I really hope this works' ideas and tell us we need to get it to work. If you did get it to work, show us how.

You did not show it in your attachment either, but you likely used ISPF file tailoring services... a key point that should have been given in your answer.

Re: Pass parameters in from REXX to JCL

PostPosted: Sat May 22, 2010 9:02 pm
by gc1958
Perhaps you can solve this from another angle by using JCL INCLUDE and SET statements. The SET statements, written by your Rexx script, would set the values of variables as you desire. Then when the JCL members are included/expanded, that values you set are substituted. Example:

//GC1958 JOB (),CLASS=A,MSGCLASS=D,NOTIFY=&SYSUID
//JCLPROCS JCLLIB ORDER=GC1958.JCL.CNTL
//*
//* Set some variables
//*
//INIT SET MYVAR1="FRIP",
// MYVAR2="FRAP",
// MYVAR3="FLOP"
//SOMESTEP INCLUDE MEMBER=MYJOB
.
.
.
The JCL in dataset GC1958.JCL.CNTL(MYJOB) would have references to MYVAR1, MYVAR2, etc. These references would be replaced by the values in the SET statements above.