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
 

 

REXX routine to find the procs executed in a set of JCLs

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
manugeorge2004

New User


Joined: 17 Jun 2009
Posts: 35
Location: Denver

PostPosted: Wed Feb 10, 2010 4:14 am    Post subject: REXX routine to find the procs executed in a set of JCLs
Reply with quote

Hi

I have a set of JCLs in a library
I need to get a list of PROCs executed in these JCLS ( EXEC statements)
Not all members in the library need to be searched.
Is there a way using REXX routine I can give the library and list of membrs and search for EXEC statement in the JCLs and create an output file

Can i get a sample for the same. I am new to REXX
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Wed Feb 10, 2010 4:27 am    Post subject: Reply to: REXX routine to find the procs executed in a set o
Reply with quote

Quote:
I am new to REXX


not a simple task for a <new to ReXX>
the fastest approach would be to use the ISPF srchfor ( searching for the EXEC Statement
after that process the result to cleanup the resulting file

if You search the forums using "SUPERC REXX" and/or "SRCHFOR REXX"
You will find lots of useful info
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 401
Location: Mumbai

PostPosted: Wed Feb 10, 2010 7:15 am    Post subject:
Reply with quote

That is a good exercise for learning Rexx... there are many ways to do this. Here is an example (with one impossible to read, but commented trick but I felt like adding it). Enrico is correct though - doing it completely is very difficult. This example won't know if it is searching in-line data (//XXX DD * or //XXX DD DATA,DLM=yy) for example. Other comments left out on purpose since it is a short learning exercise. Error checking left out for brevity.

Code:
/* Rexx                                                              */
                                                                       
pdsdsn = "DSN910.SVSC.CNTL"                                             
outdsn = "ABCDE.OUTPUT.REPORT"                                         
Call outtrap "stem."                                                   
"LISTD '" || pdsdsn || "' MEMBERS"                                     
Call outtrap "OFF"                                                     
output.0 = 0                                                           
Do a = 7 to stem.0                                                     
  stem.a = strip(stem.a)                                               
  "ALLOC REUSE SHR F(A) DA('" || pdsdsn || "(" || stem.a || ")'"       
  If rc <> 0 Then                                                       
    Do                                                                 
      Say "Alloc error... Bye!"                                         
      Exit                                                             
    End                                                                 
  "EXECIO * DISKR A (STEM LINES. FINIS"                                 
  "FREE F(A)"                                                           
  Do c = 1 to lines.0                                                   
    Parse Var lines.c op verb rest .                                   
    Parse Var rest rest "," .                                           
    If substr(op,1,2) = "//" & ,                                       
          substr(op,3,1) <> "*" & ,                                     
          verb == "EXEC" & ,                                           
          substr(rest,1,4) <> "PGM=" Then                               
      Do                                                               
        outline = left(stem.a,8) rest                                   
        Parse value 1 + output.0 outline With i output.i 1 output.0 .   
        /* Previous line is same as the following but more fun       */
        /* i=output.0 + 1                                            */
        /* output.0 = i                                              */
        /* output.i = outline                                        */
      End                                                               
  End                                                                   
End                                                                     
"ALLOC REUSE OLD F(A) DA('" || outdsn || "')"                           
"EXECIO" output.0 "DISKW A (STEM OUTPUT. FINIS"                         
"FREE F(A)"                                                             
Address ispexec "EDIT DATASET('"outdsn"')" 
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 REXX cdoe to purge a JOB from spool a... Sulabh Agrawal CLIST & REXX 11 Thu Mar 09, 2017 11:36 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm
No new posts REXX compiled via RXTCOMP sergeyken CLIST & REXX 7 Tue Feb 07, 2017 9:41 pm
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


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