View previous topic :: View next topic
|
Author |
Message |
HameedAli
Active User
Joined: 16 Apr 2009 Posts: 151 Location: India
|
|
|
|
How to edit a PDS using REXX and run the same?
The PDS which is to be edited from Rexx is a JCL that contains the following
Code: |
//SYSPRINT DD DSN=&OWNER.TOOLS.RUNQUERY.MSG(&MEM),DISP=SHR |
I want to pass the value for OWNER and MEM to REXX as parameters and edit the JCL.
How it can be done? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
If the existing JCL is in ISPF file tailoring format, all you need to do is FTINCL to resolve the variables.
If not, you need to read the whole JCL into a stem, read the stem and write to a new dataset, and then at an appropriate point would insert two lines
Code: |
// SET OWNER=whatever,
// MEM=whatever |
Finish writing the stem, and submit the new dataset
Code: |
//JOBCARD JOB .........................
//SET OWNER=ME,
// MEM=MEMBER
............. remainder of job stream ................
|
|
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Can't you just run a quick TSO/E Edit?
Code: |
/* REXX */
Queue "TOP"
Queue "C * 999999 /&OWNER/OWNER/"
Queue "TOP"
Queue "C * 999999 /&MEM/MEM/"
Queue "TOP"
Queue "END SAVE"
"EDIT 'HLQ.JCL(MEMBER)' TEXT OLD NONUM ASIS"
Exit 0
|
|
|
Back to top |
|
|
HameedAli
Active User
Joined: 16 Apr 2009 Posts: 151 Location: India
|
|
|
|
Yep, the above solution worked.
Now, I have two PDS like this
Code: |
//SYSPRINT DD DSN=&OWNER.TOOLS.RUNQUERY.MSG(&MEM),DISP=SHR
//SYSIN DD DSN=&OWNER.TOOLS.RUNQUERY.QUERY(&MEM),DISP=SHR
|
My need is to pass Owner and Mem values through a tso command, Say the JCL name is R1
I have to pass like "tso R1 23234 Mem4".
&Owner shouldMem4 take the value 23234
and &MEM should take the value
I want the JCl to retain the &owner and & mem in it for future run. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Well, now you know what to do, go do it and come back with any further problems. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2546 Location: Silicon Valley
|
|
|
|
Learn to use the PARSE ARG parameter. See the REXX Reference manual. |
|
Back to top |
|
|
|