Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Members search in PDS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Dilipmg05

New User


Joined: 16 Sep 2020
Posts: 3
Location: India

PostPosted: Wed Sep 16, 2020 11:29 pm    Post subject: Members search in PDS
Reply with quote

Hello All,

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..
Back to top
View user's profile Send private message

Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 311
Location: Bamberg, Germany

PostPosted: Thu Sep 17, 2020 12:19 am    Post subject:
Reply with quote

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.
Back to top
View user's profile Send private message
Dilipmg05

New User


Joined: 16 Sep 2020
Posts: 3
Location: India

PostPosted: Thu Sep 17, 2020 12:25 am    Post subject:
Reply with quote

PDS NAME - ABC.TEST.JCLLIB

Members example-
SITJOB1
UATJOB1
SITJOB2
UATJOB2
...
...
....
...
SITJB991
UATJB991
SITJB992
SITJB993
UATJB993


I need a logic to scan pds and final output should indicate me that, job SITJB992 doesn't have corresponding UAT jcl..
Back to top
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 386
Location: Denmark

PostPosted: Thu Sep 17, 2020 12:42 am    Post subject:
Reply with quote

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 www.cbttape.org and probably by other means too, File Manager perhaps?
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 859
Location: The Universe

PostPosted: Thu Sep 17, 2020 1:01 am    Post subject:
Reply with quote

  1. 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.
  2. 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.
  3. 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.
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 311
Location: Bamberg, Germany

PostPosted: Thu Sep 17, 2020 1:30 am    Post subject:
Reply with quote

Simple approach:
Code:
//LISTPDS  EXEC PGM=IEHLIST                                           
//SYSPRINT DD DISP=(NEW,PASS),UNIT=SYSALLDA,                           
//            SPACE=(CYL,(10,5),RLSE),                                 
//            DSORG=PS,RECFM=FBA,LRECL=121,BLKSIZE=0                   
//DD1      DD UNIT=SYSALLDA,VOL=SER=<fromvol>,DISP=SHR                   
//SYSIN    DD *                                                       
  LISTPDS DSNAME=<mydsn>,VOL=SYSALLDA=<fromvol>                         
/*                                                                     
//MATCH    EXEC PGM=ICEMAN                                             
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DISP=(OLD,PASS),DSN=*.LISTPDS.SYSPRINT                   
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                       
  OMIT COND=(1,1,SS,EQ,C'01',OR,12,1,CH,EQ,C' ',OR,22,8,BI,NE,UN,OR,   
             12,3,SS,NE,C'SIT,UAT')                                   
  INREC IFTHEN=(WHEN=(12,3,CH,EQ,C'SIT'),BUILD=(15,5,X,X'10',1Z)),     
    IFTHEN=(WHEN=NONE,BUILD=(15,5,X,X'01',1Z))                         
  SORT FIELDS=(1,5,BI,A)                                               
  SUM FIELDS=(7,2,BI)                                                 
  OUTFIL FNAMES=(SORTOUT),                                             
    OMIT=(7,1,BI,EQ,X'11'),                                           
    REMOVECC,NULLOFL=RC4,                                             
    IFTHEN=(WHEN=(7,1,BI,EQ,X'10'),                                   
      BUILD=(C'SIT',1,5,X,C'has no matching UAT')),                   
    IFTHEN=(WHEN=NONE,                                                 
      BUILD=(C'UAT',1,5,X,C'has no matching SIT'))                     
  END                                                                 
/*

Input:
Code:
           Name   
_________ SITJOB1 
_________ SITJOB2 
_________ SITJOB99
_________ UATJOB1 
_________ UATJOB3 
_________ UATJOB99

Output:
Code:
****** ****************************
000001 SITJOB2  has no matching UAT
000002 UATJOB3  has no matching SIT
****** ****************************

Job will end with RC=4 if all matches are Ok.
Back to top
View user's profile Send private message
Dilipmg05

New User


Joined: 16 Sep 2020
Posts: 3
Location: India

PostPosted: Thu Sep 17, 2020 9:26 am    Post subject:
Reply with quote

Thank you, Joerg.

I'll try your solution ☺️☺️
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2467
Location: NY,USA

PostPosted: Fri Sep 18, 2020 6:57 pm    Post subject:
Reply with quote

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
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 311
Location: Bamberg, Germany

PostPosted: Fri Sep 18, 2020 7:55 pm    Post subject:
Reply with quote

Rohit Umarjikar wrote:
2. Sort the file from pos-4 till next 5 bytes.

This extra step is not necessary when using the mentioned ICETOOL SELECT .. NODUPS method.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2467
Location: NY,USA

PostPosted: Fri Sep 18, 2020 9:52 pm    Post subject:
Reply with quote

yes indeed but just to explain the flow step 2 and 3 = 1 step. So overall two step easy solution and should work.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fetch the Dataset names from inside m... kalyan94 TSO/ISPF 18 Wed Jun 17, 2020 2:06 pm
No new posts RegEX search in ISPF editor jzhardy TSO/ISPF 4 Mon Apr 20, 2020 10:46 am
No new posts ISPF search - capturing result jzhardy TSO/ISPF 15 Sat Dec 07, 2019 5:20 am
No new posts Search the strings present in ps file... Bhuvana Narasimhan All Other Mainframe Topics 8 Thu Aug 22, 2019 8:20 pm
No new posts Is possible to concatenate multiple P... Poha Eater DFSORT/ICETOOL 6 Fri Aug 02, 2019 1:21 pm

Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us