Page 1 of 2

Searching members in a list of libraries

PostPosted: Thu Apr 21, 2011 10:25 pm
by vegafacundodaniel
Hello everybody !

I'd need to write a JCL to scan thru a list of libraries and search for a particular member in those libraries.

I'd need to display if a particular member is in.

How can i do that ?

Thanks in advance !

Re: Searching members

PostPosted: Thu Apr 21, 2011 11:28 pm
by Akatsukami
Well, you can't write a "JCL" to do this, as JCL lacks that ability.

I'd write a little piece of Rexx invoking ISPF services to accomplish this. Other participants on this forum may have preferable answers.

Re: Searching members

PostPosted: Thu Apr 21, 2011 11:59 pm
by MrSpock
Won't a normal SuperC search job locate the location of a specified member for you? Or, couldn't you just replicate something similar to what you might do in TSO?

Re: Searching members

PostPosted: Fri Apr 22, 2011 12:44 am
by NicC
x = SYSDSN("'"variable_holding_pds_name"("pgm")'")
IF x = "OK",  /* member found */

Re: Searching members

PostPosted: Fri Apr 22, 2011 1:25 am
by prino
Create a customized DSLIST via the Workplace and use the 'M' command on it.

Re: Searching members

PostPosted: Mon Apr 25, 2011 5:19 pm
by vegafacundodaniel
Sorry Prino, I don't understand your alternative. Could you give me more details please ?

Re: Searching members

PostPosted: Fri Jul 08, 2011 3:39 pm
by Priya85
Please try below once.

Give High level qualifiers (Test.*) in 3.4 option of command level then press enter you will get PDS list so again give M along with member name at
Command level you will found the member in your required PDS lists where it is resides.
Example: m ADDPGM

Re: Searching members

PostPosted: Sat Sep 10, 2011 8:55 am
by gauthamnagpur18
Hi ,

Try this ..!! :ugeek:

//SEARCH  EXEC PGM=ISRSUPC,PARM=(SRCHCMP,'ANYC')       
//*                                                   
//NEWDD   DD   DISP=SHR,DSN= pds name         
//*                                                   
//OUTDD   DD   SYSOUT=*                               
//SYSIN   DD          *                               
SRCHFOR  'member name'               
/*

Re: Searching members

PostPosted: Sat Sep 10, 2011 10:28 am
by enrico-sorichetti
I'd need to write a JCL to scan thru a list of libraries and search for a particular member in those libraries.
I'd need to display if a particular member is in.

read and meditate twice on the requirement before posting misleading solutions
( and after two months the TS should have already got away with it )

5.5.5.13 SRCHFOR command
Use the SRCHFOR primary command to search the data sets in the data set list for one or more strings of data using the SuperC Utility (see Option 3.14). You may limit the search to excluded or non-excluded data sets, and control whether migrated data sets are recalled and searched or not. Use this format:


the TS asked on how to determine if a member is present in a set/list of libraries
it means look at the directories, not at the content ..
so the geek icon is out of place for a wrong solution :ugeek:

Re: Searching members

PostPosted: Sat Sep 10, 2011 11:11 am
by enrico-sorichetti
Follow on ...
cut and paste from the wrong page...
anyway the concept is the same...
ISRSUPC will search the content... not the directory

to be sure I spent about 20 seconds testing it,
and it does behave as I told

here is a snippet of the directory
 DSLIST            ENRICO.SORT.JCL                           Row 00001 of 00037
 Command ===>                                                  Scroll ===> CSR 
            Name     Prompt       Size   Created          Changed          ID   
 _________ ESDS                     20  2011/07/14  2011/07/14 10:34:26  ENRICO
 _________ GENR01                   73  2011/05/09  2011/05/09 22:36:26  ENRICO
 _________ GENR02                    9  2011/05/09  2011/05/09 22:43:11  ENRICO
 _________ ITOOL01                  23  2010/12/02  2011/05/20 13:43:55  ENRICO
 _________ ITOOL02                  23  2011/06/15  2011/06/15 10:10:21  ENRICO
 _________ ITOOL03                  18  2011/09/07  2011/09/07 18:29:31  ENRICO
 _________ SORT00                   11  2011/05/12  2011/05/12 19:02:17  ENRICO
 _________ SORT01                   39  2010/12/07  2010/12/07 08:51:07  IBMUSER
 _________ SORT02                   54  2011/03/03  2011/03/03 12:42:49  IBMUSER
 _________ SORT03                   57  2011/05/12  2011/05/12 16:26:02  ENRICO
 _________ SORT04                   28  2011/05/16  2011/05/16 09:13:44  ENRICO
 _________ SORT05                   26  2011/05/19  2011/05/19 09:36:10  ENRICO



here is the job
 ****** ***************************** Top of Data ******************************
 000001 //ENRICO4 JOB MSGCLASS=X                                               
 000002 //SEARCH  EXEC PGM=ISRSUPC,                                           *
 000003 //            PARM=(SRCHCMP,                                           
 000004 //            'ANYC')                                                   
 000005 //NEWDD  DD DSN=ENRICO.SORT.JCL,                                       
 000006 //          DISP=SHR                                                   
 000007 //OUTDD  DD SYSOUT=*                                                   
 000008 //SYSIN  DD *                                                           
 000009 SRCHFOR  'SORT00'                                                       
 ****** **************************** Bottom of Data ****************************

here is the output

********************************* TOP OF DATA **********************************
                         J E S 2  J O B  L O G  --  S Y S T E M  S Y S 1  --  N
                                                                               
07.34.50 JOB04091 ---- SATURDAY,  10 SEP 2011 ----                             
07.34.50 JOB04091  IRR010I  USERID ENRICO   IS ASSIGNED TO THIS JOB.           
07.34.50 JOB04091  ICH70001I ENRICO   LAST ACCESS AT 07:33:48 ON SATURDAY, SEPTE
07.34.50 JOB04091  $HASP373 ENRICO4  STARTED - INIT 1    - CLASS A - SYS SYS1   
07.34.50 JOB04091  IEF403I ENRICO4 - STARTED - TIME=07.34.50                   
07.34.50 JOB04091  IEF404I ENRICO4 - ENDED - TIME=07.34.50                     
07.34.50 JOB04091  $HASP395 ENRICO4  ENDED                                     
------ JES2 JOB STATISTICS ------                                               
  10 SEP 2011 JOB EXECUTION DATE                                               
            9 CARDS READ                                                       
           49 SYSOUT PRINT RECORDS                                             
            0 SYSOUT PUNCH RECORDS                                             
            2 SYSOUT SPOOL KBYTES                                               
         0.00 MINUTES EXECUTION TIME                                           
        1 //ENRICO4 JOB MSGCLASS=X                                             
        2 //SEARCH  EXEC PGM=ISRSUPC,                                           
          //            PARM=(SRCHCMP,                                         
          //            'ANYC')                                                 
        3 //NEWDD  DD DSN=ENRICO.SORT.JCL,                                     
          //          DISP=SHR                                                 
        4 //OUTDD  DD SYSOUT=*                                                 
        5 //SYSIN  DD *                                                         
ICH70001I ENRICO   LAST ACCESS AT 07:33:48 ON SATURDAY, SEPTEMBER 10, 2011     
IEF236I ALLOC. FOR ENRICO4 SEARCH                                               
IEF237I 0AB3 ALLOCATED TO NEWDD                                                 
IEF237I JES2 ALLOCATED TO OUTDD                                                 
IEF237I JES2 ALLOCATED TO SYSIN                                                 
IEF142I ENRICO4 SEARCH - STEP WAS EXECUTED - COND CODE 0000                     
IEF285I   ENRICO.SORT.JCL                              KEPT                     
IEF285I   VOL SER NOS= STOR03.                                                 
IEF285I   ENRICO.ENRICO4.JOB04091.D0000102.?           SYSOUT                   
IEF285I   ENRICO.ENRICO4.JOB04091.D0000101.?           SYSIN                   
IEF373I STEP/SEARCH  /START 2011253.0734                                       
IEF374I STEP/SEARCH  /STOP  2011253.0734 CPU    0MIN 00.11SEC SRB    0MIN 00.01S
IEF375I  JOB/ENRICO4 /START 2011253.0734                                       
IEF376I  JOB/ENRICO4 /STOP  2011253.0734 CPU    0MIN 00.11SEC SRB    0MIN 00.01S
  ISRSUPC   -   MVS/PDF FILE/LINE/WORD/BYTE/SFOR COMPARE UTILITY- ISPF FOR z/OS
     SEARCH-FOR SUMMARY SECTION            SRCH DSN: ENRICO.SORT.JCL           
                                                                               
LINES-FOUND  LINES-PROC  MEMBERS-W/LNS  MEMBERS-WO/LNS  COMPARE-COLS  LONGEST-LI
        0         1132            0             37           1:80           80 
                                                                               
PROCESS OPTIONS USED: ANYC                                                     
                                                                               
THE FOLLOWING PROCESS STATEMENTS (USING COLUMNS 1:72) WERE PROCESSED:           
   SRCHFOR  'SORT00'                                                           
                                                                               
******************************** BOTTOM OF DATA ********************************