Page 1 of 1

Finding out PROC's from a JCL Lib

PostPosted: Fri Apr 13, 2012 8:54 am
by sinmani
Hi Friends,

If we have a JCL library having hundreds of Jobs. Now I want to list all the PROCS which are being used in this library.

How can we do it??

Well I think Rexx should be best way to do it but not everyone knows it. Is there any other way??

Re: Finding out PROC's from a JCL Lib

PostPosted: Fri Apr 13, 2012 12:33 pm
by BillyBoyo
If you have access to anything which can search members in a PDS, you could use that.

Do you just want to "look" at the output or do something with it?

Re: Finding out PROC's from a JCL Lib

PostPosted: Fri Apr 13, 2012 12:36 pm
by sinmani
Yes we have a search tool.

srchfor 'XXXX'

Here we can use like SRCHFOR ' PROC' and this would give me the number of occurence of PROC which means number of PROCs being used.

What I want is to make a repository of the PROC names.

Re: Finding out PROC's from a JCL Lib

PostPosted: Fri Apr 13, 2012 1:17 pm
by enrico-sorichetti
in a library containg JCLs referring to PROCS
most probably searching for the word PROC will not return anything useful

I have seldom seen in JCL the construct EXEC PROC=<procname>
usually everybody writes EXEC <procname>

the most reasonable approach is to use SRCHFOR to search for the word EXEC
and process afterward the result wit SORT or REXX to extract the token that follows the EXEC word
and disambiguate between
EXEC PGM=
EXEC PROC=
EXEC <procname>

it is enough to ...

check for "//" in columns 1-2
scan/find the EXEC word
extract the token/word that follows
-- providing that the token could be " " terminated or "," terminated
reparse the token found for disambiguation

Re: Finding out PROC's from a JCL Lib

PostPosted: Fri Apr 13, 2012 11:15 pm
by Akatsukami
I would also check that column 3 is not an asterisk (*). You might think that no one would be so stupid as to write JCL that would meet Dr. Sorichetti's criteria and not mine. You would be wrong.

Re: Finding out PROC's from a JCL Lib

PostPosted: Fri Apr 13, 2012 11:49 pm
by BillyBoyo
Also EXEC should be second token in line, not just "found" somewhere in the line.

// EXEC APROC
// EXEC PROC=APROC
//* EXEC APROC
//STEPN EXEC APROC
//THISDD DD DSN=A.DATA.SET,DISP=OLD Updated for EXEC APROC below
//A DD DSN=ANOTHER.DATA.SET,DISP=(OLD,DELETE) If EXEC above fails


Should find 1, 2 and 4 and ignore the rest, which are comments.