Finding out PROC's from a JCL Lib



Finding out PROC's from a JCL Lib

Postby sinmani » Fri Apr 13, 2012 8:54 am

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??
-----------------------------------------
As long as you think you are a student, you are doing well.
The day you consider yourself as the master of the game..........well
sinmani
 
Posts: 93
Joined: Thu Mar 22, 2012 10:02 am
Has thanked: 14 times
Been thanked: 0 time

Re: Finding out PROC's from a JCL Lib

 

Re: Finding out PROC's from a JCL Lib

Postby BillyBoyo » Fri Apr 13, 2012 12:33 pm

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?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Finding out PROC's from a JCL Lib

Postby sinmani » Fri Apr 13, 2012 12:36 pm

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.
-----------------------------------------
As long as you think you are a student, you are doing well.
The day you consider yourself as the master of the game..........well
sinmani
 
Posts: 93
Joined: Thu Mar 22, 2012 10:02 am
Has thanked: 14 times
Been thanked: 0 time

Re: Finding out PROC's from a JCL Lib

Postby enrico-sorichetti » Fri Apr 13, 2012 1:17 pm

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2636
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 129 times

Re: Finding out PROC's from a JCL Lib

Postby Akatsukami » Fri Apr 13, 2012 11:15 pm

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.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1052
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Finding out PROC's from a JCL Lib

Postby BillyBoyo » Fri Apr 13, 2012 11:49 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times


Return to Interview Questions