Searching members in a list of libraries



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Searching members in a list of libraries

Postby vegafacundodaniel » Thu Apr 21, 2011 10:25 pm

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 !
vegafacundodaniel
 
Posts: 61
Joined: Tue Jul 20, 2010 4:27 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Searching members

Postby Akatsukami » Thu Apr 21, 2011 11:28 pm

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.
"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: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Searching members

Postby MrSpock » Thu Apr 21, 2011 11:59 pm

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?
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: Searching members

Postby NicC » Fri Apr 22, 2011 12:44 am

x = SYSDSN("'"variable_holding_pds_name"("pgm")'")
IF x = "OK",  /* member found */
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Searching members

Postby prino » Fri Apr 22, 2011 1:25 am

Create a customized DSLIST via the Workplace and use the 'M' command on it.
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 641
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 29 times

Re: Searching members

Postby vegafacundodaniel » Mon Apr 25, 2011 5:19 pm

Sorry Prino, I don't understand your alternative. Could you give me more details please ?
vegafacundodaniel
 
Posts: 61
Joined: Tue Jul 20, 2010 4:27 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Searching members

Postby Priya85 » Fri Jul 08, 2011 3:39 pm

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
Priya85
 
Posts: 2
Joined: Mon Jul 04, 2011 3:20 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Searching members

Postby gauthamnagpur18 » Sat Sep 10, 2011 8:55 am

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'               
/*
gauthamnagpur18
 
Posts: 93
Joined: Sat Oct 23, 2010 1:28 pm
Location: Chennai, India
Has thanked: 3 times
Been thanked: 3 times

Re: Searching members

Postby enrico-sorichetti » Sat Sep 10, 2011 10:28 am

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:
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: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: Searching members

Postby enrico-sorichetti » Sat Sep 10, 2011 11:11 am

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 ********************************
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: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Next

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post