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

Scan JCL library and extract proc name


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
coxdavi

New User


Joined: 12 Mar 2009
Posts: 30
Location: usa

PostPosted: Fri May 22, 2009 12:26 am
Reply with quote

What would be the best way to scan a PDS of JCL members and extract the proc name ? I need the job name and the proc name for a compare of proc names, and if a match, then I want the job names on the match only, discarding the non-match job names.


Thanks,
Dave
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri May 22, 2009 12:38 am
Reply with quote

Hello,

From what you have posted, this is not a jcl question. . . .

If you better explain just what you want to do, someone may have a suggestion as to where to move the topic.

Show some sample input and the output you want from that input.
Back to top
View user's profile Send private message
coxdavi

New User


Joined: 12 Mar 2009
Posts: 30
Location: usa

PostPosted: Fri May 22, 2009 1:05 am
Reply with quote

Dick,
I thought this would be the proper place as I am concerned with looking at members in a PDS containing JCL. I wish to scan the members for proc names. I then wish to take the jobname and the proc name from the members and store them in an output file. I will then take that output file as input to a compare of procs. If I match that file to another already existing file of procs containing a certain program, then I want the jobname written to another file. I will then have a list of JCL members that contain procs running that certain program. That gives me a percentage of batch jobs running the certain program.

Thanks,
Dave
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri May 22, 2009 1:31 am
Reply with quote

Hi Dave,

JCL can't do what you want to do - some kind of code will have to be executed. Might be your sort product, rexx, some other utility, etc.

As i mentioned before, you need to post some sample "input" and the output you want when that input is processed. Show some sample members that would be selected by your process and some that would not.

You mention jobname - is that the member name? What if a member does not have a JOB statement? What if a member executes multiple procs?

You now mention additoinal processing, so it would be best if you post samples of the intermediate files created by this process as well as any "other" files like "already existing file of procs containing a certain program". Someone may be able to help with how to implement, but you need to provide clear, complete examples. As they say - a picture is worth 1000 words.
Back to top
View user's profile Send private message
coxdavi

New User


Joined: 12 Mar 2009
Posts: 30
Location: usa

PostPosted: Fri May 22, 2009 1:53 am
Reply with quote

Dick,
Yes, I would be using Easytrieve to do the compares ( Match processing ). All members in the JCL library must have a job card. JCL sample would be like this:

//OPSD022D JOB (999999,410101),,MSGCLASS=X,CLASS=W
/*JOBPARM P=PROC01
//JOBLIB DD DSN=SYS1.EZTRIEVE.LINKLIB,DISP=SHR
//STEP001 EXEC OPSD022P

I can get the jobname from looking for " JOB " in columns 12 through 14, then the jobname is columns 3 throught 10.

Next, would be to go through the following card images and find " EXEC ". Having found that literal, I would then check a number of field ranges, extracting any results along with the jobname into a list.

I would then compare the proc field with another list of known procs containing the program, giving the associated jobname.

Ok, I have explained three times. Looks like it is time to go do it. icon_smile.gif

I will let you know when I am done. Thanks for listening.


Dave
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri May 22, 2009 2:28 am
Reply with quote

Hi Dave,

You're welcome icon_smile.gif

Quote:
Looks like it is time to go do it.
Sounds like a plan.

Sounds like you'll be good to go once you have created the JOB/PROC xref list/file.

Someone will be here if there are questions.
Back to top
View user's profile Send private message
mtaylor

Active User


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

PostPosted: Fri May 22, 2009 6:09 pm
Reply with quote

Quote:
I can get the jobname from looking for " JOB " in columns 12 through 14, then the jobname is columns 3 throught 10.

Next, would be to go through the following card images and find " EXEC ". Having found that literal, I would then check a number of field ranges, extracting any results along with the jobname into a list.


Generally, this 12-14 assumption isn't true. If your installation has all 8 character job and step names (and every job has single spacing around the job name) then it will work. Essentially, JOB and EXEC (step) names are optional and if present may contain 1-8 characters (of course it doesn't make sense to NOT have a jobname). White space is significant, and it's meaning depends on the context. That's just one reason 'standard' parsing techniques aren't a good fit for JCL.
Back to top
View user's profile Send private message
coxdavi

New User


Joined: 12 Mar 2009
Posts: 30
Location: usa

PostPosted: Fri May 22, 2009 8:54 pm
Reply with quote

Yes, thanks for the heads-up on the JOB statement. I am sure that I would have stumbled into the need to do the same for the literal JOB as I will have to do for the literal EXEC. Yes, true, not all jobnames are 8 characters, so a little more work. I appreciate your input.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
No new posts Calling an Open C library function in... CICS 1
No new posts Submit multiple jobs from a library t... JCL & VSAM 14
No new posts Duplicate several members of/in one l... JCL & VSAM 7
Search our Forums:

Back to Top