IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

To edit a PDS(which is a JCL) using REXX and run the same


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
HameedAli

Active User


Joined: 16 Apr 2009
Posts: 151
Location: India

PostPosted: Mon Aug 10, 2009 4:42 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Aug 10, 2009 4:51 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Aug 10, 2009 5:56 pm
Reply with quote

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
View user's profile Send private message
HameedAli

Active User


Joined: 16 Apr 2009
Posts: 151
Location: India

PostPosted: Tue Aug 11, 2009 11:04 am
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Aug 11, 2009 11:09 am
Reply with quote

Well, now you know what to do, go do it and come back with any further problems.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Tue Aug 11, 2009 9:53 pm
Reply with quote

Learn to use the PARSE ARG parameter. See the REXX Reference manual.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
Search our Forums:

Back to Top