Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
To edit a PDS(which is a JCL) using REXX and run the same

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: To edit a PDS(which is a JCL) using REXX and run the same
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: 8593
Location: Back in jolly old England

PostPosted: Mon Aug 10, 2009 4:51 pm    Post subject:
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

Moderator Team Head


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

PostPosted: Mon Aug 10, 2009 5:56 pm    Post subject: Reply to: To edit a PDS(which is a JCL) using REXX and run t
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    Post subject: Reply to: To edit a PDS(which is a JCL) using REXX and run t
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: 8593
Location: Back in jolly old England

PostPosted: Tue Aug 11, 2009 11:09 am    Post subject:
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

Senior Member


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

PostPosted: Tue Aug 11, 2009 9:53 pm    Post subject: Reply to: To edit a PDS(which is a JCL) using REXX and run t
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts Creating ISPF Screens with Scrname vi... Albireo20 TSO/ISPF 9 Tue Sep 05, 2017 4:24 pm
No new posts How to Run Rexx Macro? Kalaivignesh CLIST & REXX 5 Fri Sep 01, 2017 9:08 pm
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us