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

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


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

New User


Joined: 17 Jun 2009
Posts: 38
Location: Denver

PostPosted: Wed Feb 10, 2010 4:14 am
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Feb 10, 2010 4:27 am
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: 400
Location: Mumbai

PostPosted: Wed Feb 10, 2010 7:15 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
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
Search our Forums:

Back to Top