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

To read line by line in jcl,proc and manipulate the same


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

New User


Joined: 22 May 2007
Posts: 3
Location: Bangalore

PostPosted: Sat Dec 26, 2009 8:30 pm
Reply with quote

Hi,
I want to create a REXX tool change a prod jcl to test jcl by changing some jcl parameters and passing some symbolic parameters to the jcl. I want to pass an environment variable and jobname from an ispf panel and then the REXX tool should make the appropriate changes to the prod
jcl.

Also I want to read each line of a proc and if a parmlib member is encountered , the tool should go to the parmlib and search in the member for a string, if found the parmlib should be changed and a symbolic parameter should be introduced for the same in proc.

Also some steps should be commented out based on a parmlib member and exec pgm.

Please let me know if there is anyway of doing this thru REXX.

Also please send me the link of some rexx tool development materials.

Thanks,
Rashmi
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Dec 26, 2009 9:41 pm
Reply with quote

since You asked for a Yes/no answer, thats what You are going to get
Yes... it can be done ( if You have the skill )

for the rexx manuals here they are ( not the last ones, but enough to get started
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/Shelves/IKJ4BK80

if You want to search for the latest fashion here is the whole manuals shebang
www-03.ibm.com/systems/z/os/zos/bkserv/index.html

if You want to see rexx in action here is a pointer to a jcl parser I wrote
ibmmainframes.com/viewtopic.php?t=32494
Back to top
View user's profile Send private message
rashmi1482

New User


Joined: 22 May 2007
Posts: 3
Location: Bangalore

PostPosted: Sun Dec 27, 2009 1:06 pm
Reply with quote

Hi,

Could you helpme on how to go about reading each line of a jcl with REXX because this the first thing that needs to be implemented in my case.

My idea is
1. Ge to the job name and the environmnet name from a panel.
2. Go to the job and make changes depending on the environment using rexx.
3. For this read line by line of jcl and make changes to the required parameters.

Please help me on how to read line by line of the jcl.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sun Dec 27, 2009 1:14 pm
Reply with quote

If You are so new to rexx that You cannnot read a line from a pds member or sequential dataset,

it would be wiser to review You planning in order to provide time for training.

I posted the link to the docs, You might also search the forums for "EXECIO",
You will find lots of samples and hints on reading
( also on using edit macros to achieve what You want )

I do not judge I state
why everybody wants to build tools without having the basic skills ??
Back to top
View user's profile Send private message
mtaylor

Active User


Joined: 20 Feb 2009
Posts: 108
Location: Kansas City

PostPosted: Mon Dec 28, 2009 7:29 pm
Reply with quote

This topic comes up pretty frequently. What the op is asking for is a tool to refactor jcl. My question is; why rexx on the mainframe? Why not transfer the jcl to a pc, do the changes there, and transfer back to the mainframe? Then you have access to all the tools and languages in the pc world like python etc and aren't limited to only rexx?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Thu Dec 31, 2009 2:48 am
Reply with quote

mtaylor wrote:
This topic comes up pretty frequently. What the op is asking for is a tool to refactor jcl. My question is; why rexx on the mainframe? Why not transfer the jcl to a pc, do the changes there, and transfer back to the mainframe? Then you have access to all the tools and languages in the pc world like python etc and aren't limited to only rexx?


  1. You aren't limited to just Rexx on the mainframe, although 90% of the posters here have apparently only ever heard of "Rexx" and "JCL".
  2. That same 90% would be pressed to their limits to do that transfer once. Asking them to automate it for hundreds of data sets transferred and modified by dozens of users would reduce them to tears of frustration.
  3. Hi, Opal!
Back to top
View user's profile Send private message
valyk

Active User


Joined: 16 Apr 2008
Posts: 104
Location: South Carolina

PostPosted: Tue Jan 05, 2010 12:41 am
Reply with quote

It just so happens that I had a need to do something very similar for our CICS regions:

Code:
/* Search proc for parmlib */
READ_PROC:
  ADDRESS TSO
  "ALLOC DATASET('"INPROC"("IN_NAME")') FILE(INPROC) SHR"
  "EXECIO * DISKR INPROC (FINIS STEM INPROC."
  "FREE FILE(INPROC)"

  DO I = 1 TO INPROC.0
    IF POS('PARMLIB('||OUT_NAME,INPROC.I) > 0 THEN DO
      PARSE VAR INPROC.I 'DSN=' INPARM '('

      CALL READ_PARM
    END
  END
RETURN

/* Read parmlib and search for GRPLIST parameters */
READ_PARM:
  ADDRESS TSO
  "ALLOC DATASET('"INPARM"("IN_NAME")') FILE(INPARM) SHR"
  "EXECIO * DISKR INPARM (FINIS STEM INPARM."
  "FREE FILE(INPARM)"

  DO I = 1 TO INPARM.0
    IF POS('GRPLIST=(',INPARM.I) > 0 THEN
      PARSE VAR INPARM.I 'GRPLIST=(' IBMLIST ',' PRODUCT ',' JOB ')' .
  END
RETURN
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 Error to read log with rexx CLIST & REXX 11
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Random read in ESDS file by using RBA JCL & VSAM 6
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
No new posts rewrite same SAY line CLIST & REXX 8
Search our Forums:

Back to Top