I have a PDS that contains thousands of SIT JCLs and UAT JCLs.
SIT jcls are like SITJOB1. Corresponding UAT jcl will be like UATJOB1 and so on.
Now that I need to scan this common pds to see if all SIT jobs have corresponding UAT version.. Is there a logic in JCL that could help me to scan this PDS?? Thanks in advance..
Joined: 15 Aug 2015 Posts: 1348 Location: Bamberg, Germany
Provide sample data for Input/Output that one can see what logic would be required and what program to use for.
In general you can use e.g. IEHLIST or LISTDS to get a list of Member Names and process them in a later step with a SORT utility to find the matching pairs.
1. IEHLIST LISTPDS output
2. ISPF SRCHFOR in batch
3. Merge the lists and pick where members from list1 is not in list2.
This is a programming exercise, not JCL.
Both lists could also be generated by the PDS86 program from file 182 at Use [URL] BBCode for External Links and probably by other means too, File Manager perhaps?
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
JCL is not a programming language or a scripting language like Shell in Unix or Perl. It cannot loop, nor can it directly obtain and analyze data. It is simply a means to direct the system to run user programs and specify at least some of the data resources the programs require.
The first part of your task is to obtain the member names in the Partitioned Data Set. Joerg.Findeisen proposed using IEHLIST or LISTDS. Personally, I cannot recommend IEHLIST. It is simple to run in a batch environment, but its setup requirement in JCL is slightly complicated. LISTDS is a TSO line mode command. Unlike IEHLIST it requires a TSO environment to run, but its printed output is slightly easier for another program to process. Mr. Jensen suggested using ISPF SRCHFOR, but ISPF requires moderately complex JCL to prepare the environment for ISPF, so I so not think that is very viable. If PDS86 is already available in your environment it might be a viable alternative to LISTDS.
With the list of members, you can easily write a program to analyze the list. The program can be in any computer language you are comfortable using.
How about this approach ?
1. Use IEHLIST to get input Data Set with all Member names.
2. Sort the file from pos-4 till next 5 bytes.
3. Use this link to separate Duplicate vs unique. The unique Data set created is the one you are looking for.
Split a file into unique vs duplicate records