Searching PDS for a particular member



IBM's Command List programming language & Restructured Extended Executor

Searching PDS for a particular member

Postby RajeshT » Tue Nov 22, 2011 8:32 pm

Hi Everyone !!

I'm new to REXX and CLIST. I use JCL, VSAM and other batch utilities to good extent. Is it possible to scan through a PDS and search if a particular member is available in the PDS. I have about half a million PDS datasets that are to be searched for specific MEMEBERs within them inside. I have an input file listed with MEMBER name and the PDS name and i wanted to know whether the MEMBER is available in the PDS listed or not. please see the sample data from the input file below;


    PID#SPW #910350.DBRMLIB           
    PIDMDU1 #910350.DBRMLIB           
    PEY2793 #911196.CFMPO.TDBRM       
    TEC0992 #912.TECAPS.DBRMLIB       
    TEC1914 #912.TECAPS.DBRMLIB       
    DSNTIAD #955877.DSN710.DBRMLIB.DATA
    ASNPRUNU#999336.HCHOI.SASNDBRM     
    RPSSQL01#999609.SHRWARE.DBRM       
    ASNMIG8 DB2.DPROP.SASNDBRM         
    DSN8CC2 DB2ADM2.DBRMLIB.DATA       
    MCMDBLG DB2P.DBRMLIB
    MCMSPRN2DB2P.DBRMLIB


First 8 characters represents the MEMBER name and 44 characters from position 9 represent the PDS name. Appreciate your response.

Thank you for the assistance.
Rajesh.
RajeshT
 
Posts: 22
Joined: Tue May 04, 2010 10:19 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Searching PDS for a particular member

Postby enrico-sorichetti » Tue Nov 22, 2011 9:00 pm

here is a quick and dirty REXX script
using the SYSDSN function described here
http://publibz.boulder.ibm.com/cgi-bin/ ... SPTTSOSDSN

if the input file contains the data described You might try something along the lines of

 000009 /* REXX */                                                             
 000010 Address TSO "EXECIO 1 DISKR SYSUT1 ( STEM buf."                         
 000011 do while ( RC = 0 )                                                     
 000012    tmp = space(buf.1)                                                   
 000013    parse var tmp mbr pds                                               
 000014    flg = sysdsn("'"pds"("mbr")'")                                       
 000015    say left(mbr,8) left(pds,44) flg                                     
 000016    Address TSO "EXECIO 1 DISKR SYSUT1 ( STEM buf."                     
 000017 end                                                                     
 000018 exit                                                                   


and running it with a jcl along the lines of

 000025 //S2      EXEC PGM=IKJEFT1A,PARM='<the rexx script name>'
 000026 //SYSPROC   DD DISP=SHR,                                         
 000027 //             DSN=<the pds containing the rexx script>                             
 000028 //SYSPRINT  DD SYSOUT=*                                                 
 000029 //SYSTSPRT  DD SYSOUT=*                                                 
 000030 //SYSTSIN   DD DUMMY                                                   
 000031 //SYSUT1    DD *                                                       
 000032 YES      ENRICO.TEST.PDS                                               
 000033 NO     ENRICO.TEST.PDS                                               
 ****** **************************** Bottom of Data ****************************


will yield

YES      ENRICO.TEST.JCL                              OK                       
NO       ENRICO.TEST.JCL                              MEMBER NOT FOUND         



quick and dirty to show a possibility
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: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Searching PDS for a particular member

Postby Robert Sample » Tue Nov 22, 2011 9:02 pm

I have about half a million PDS datasets that are to be searched for specific MEMEBERs within them inside.
My mind completely shuts down at this point. Who would allow such an out-of-control organization to persist?
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Searching PDS for a particular member

Postby prino » Tue Nov 22, 2011 9:27 pm

Robert Sample wrote:
I have about half a million PDS datasets that are to be searched for specific MEMEBERs within them inside.
My mind completely shuts down at this point. Who would allow such an out-of-control organization to persist?

Actually, if an organisation uses ChangeMan, there is a fair chance that there will that number of PDS'es - been there seen that...
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 635
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 28 times

Re: Searching PDS for a particular member

Postby enrico-sorichetti » Tue Nov 22, 2011 9:31 pm

follow on ..
I had not noticed the fixed record layout ...
substitute
000012    tmp = space(buf.1)                                                   
000013    parse var tmp mbr pds     

with
000012    mbr = strip(substr(buf.1,1,8 ))
000013    pds = strip(substr(buf.1,9,44))
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: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post