Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 4648
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: 2025
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
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us