Pass parameters in from REXX to JCL



IBM's Command List programming language & Restructured Extended Executor

Pass parameters in from REXX to JCL

Postby meowmeow » Sat Apr 17, 2010 9:22 pm

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)'"
meowmeow
 
Posts: 8
Joined: Thu Feb 18, 2010 5:37 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Pass parameters in from REXX to JCL

Postby MrSpock » Sun Apr 18, 2010 2:22 am

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.
User avatar
MrSpock
Global moderator
 
Posts: 807
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: Pass parameters in from REXX to JCL

Postby dick scherrer » Sun Apr 18, 2010 7:07 am

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

Re: Pass parameters in from REXX to JCL

Postby Bala1 » Mon Apr 19, 2010 2:57 pm

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...
_____________________
Cheers,
Bala
Bala1
 
Posts: 15
Joined: Tue Apr 06, 2010 7:07 pm
Location: London, United Kingdom
Has thanked: 0 time
Been thanked: 0 time

Re: Pass parameters in from REXX to JCL

Postby expat » Mon Apr 19, 2010 4:37 pm

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.
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times

Re: Pass parameters in from REXX to JCL

Postby Bala1 » Mon Apr 19, 2010 5:41 pm

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...
You do not have the required permissions to view the files attached to this post.
_____________________
Cheers,
Bala
Bala1
 
Posts: 15
Joined: Tue Apr 06, 2010 7:07 pm
Location: London, United Kingdom
Has thanked: 0 time
Been thanked: 0 time

Re: Pass parameters in from REXX to JCL

Postby dick scherrer » Tue Apr 20, 2010 12:02 am

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

Re: Pass parameters in from REXX to JCL

Postby Pedro » Wed Apr 21, 2010 2:16 am

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.
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: Pass parameters in from REXX to JCL

Postby gc1958 » Sat May 22, 2010 9:02 pm

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.
gc1958
 
Posts: 4
Joined: Sat May 22, 2010 1:27 am
Has thanked: 0 time
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post