Page 1 of 1

Scanning through PDS using SYNCSORT

PostPosted: Tue Nov 22, 2011 7:47 pm
by RajeshT
Hi Everyone !!

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.

Thank you for the assistance.
Rajesh.

Re: Scanning through PDS using SYNCSORT

PostPosted: Tue Nov 22, 2011 8:08 pm
by enrico-sorichetti
If You want good answers learn to post good questions
Scanning through PDS using SYNCSORT

most probably the reply will be ... IT CANNOT BE DONE
why not just describe the requirement and let the people willing to help provide advice on the most appropriate solution ?

asking questions in this way is like asking... how to drive a nail with a screwdriver
and expect good replies

Re: Scanning through PDS using SYNCSORT

PostPosted: Tue Nov 22, 2011 8:16 pm
by RajeshT
Hi Enrico,

I wanted to confirm if there is a way to get this done through syncsort. I welcome if there are solutions using REXX / CLIST, am not familiar with any of them though. Thank you for the response.

rajesh.

Re: Scanning through PDS using SYNCSORT

PostPosted: Tue Nov 22, 2011 8:49 pm
by Akatsukami
RajeshT wrote:Hi Enrico,

I wanted to confirm if there is a way to get this done through syncsort. I welcome if there are solutions using REXX / CLIST, am not familiar with any of them though. Thank you for the response.

rajesh.

Tested, but 95% of error checking omitted. If you've really got 500,000 PDSs, run it in the background.

/* Rexx */                                                             
/* Written Heisei 23.11.22 BY Akatsukami-sama                        */
  trace o                                                             
  arg inputds .                                                       
  "ALLOC DA('"inputds"') FI(TULIN) SHR REU"                           
  "EXECIO 1 DISKR TULIN"                                               
                                                                       
  do while (rc=0)                                                     
    pull line                                                         
    member   = strip(substr(line,1,8))                                 
    library  = strip(substr(line,9,44))                               
    searchds = library'('member')'                                     
    rs       = sysdsn("'"searchds"'")                                 
                                                                       
    select                                                             
      when (rs="OK") then                                             
        say member "found in library" library                         
      when (rs="MEMBER NOT FOUND") then                               
        say member "not found in library" library                     
      otherwise do                                                     
        say "Error searching for member" member "in library",         
            library "is:"                                             
        say "    " rs                                                 
      end                                                             
    end                                                               
                                                                       
    "EXECIO 1 DISKR TULIN"                                             
  end                                                                 
                                                                       
  "EXECIO 0 DISKR TULIN (FINIS"                                       
  "FREE FI(TULIN)"                                                     
  exit                                                                 

Re: Scanning through PDS using SYNCSORT

PostPosted: Tue Nov 22, 2011 10:10 pm
by RajeshT
Yeahh .. it worked. Thank you much Akatsukami !!

/***************REXX***********/                     
TRACE O                                             
INFILE1='#910116.SYSDBRM.DB2P.DT1121'               
"ALLOCATE FI(TULIN) DA('"INFILE1"') SHR REUSE"       
"EXECIO 1 DISKR TULIN"                               
DO WHILE (RC=0)                                     
    PULL LINE                                       
    MEMBER   = STRIP(SUBSTR(LINE,1,8))               
    LIBRARY  = STRIP(SUBSTR(LINE,9,44))             
    SEARCHDS = LIBRARY'('MEMBER')'                   
    RS       = SYSDSN("'"SEARCHDS"'")               
    SELECT                                           
          WHEN (RS="OK") THEN                       
            SAY MEMBER "FOUND IN LIBRARY" LIBRARY   
          WHEN (RS="MEMBER NOT FOUND") THEN         
            SAY MEMBER "NOT FOUND IN LIBRARY" LIBRARY
          OTHERWISE DO                               
            SAY "ERROR SEARCHING FOR MEMBER" MEMBER "IN LIBRARY",
                LIBRARY "IS:"                                   
            SAY "    " RS                                       
          END                                                   
    END                                                         
"EXECIO 1 DISKR TULIN"                                           
END                                                             
"EXECIO 0 DISKR TULIN (FINIS"                                   
"FREE FI(TULIN)"                                                 
EXIT


Thank you Enrico for your suggestion. Everyone have a good one ahead.

Rajesh.

Re: Scanning through PDS using SYNCSORT

PostPosted: Thu Dec 01, 2011 3:02 pm
by pjagathis
Hi Rajesh/Akatsukami,

Please let me know what we want ot give in INFILE1...

Re: Scanning through PDS using SYNCSORT

PostPosted: Thu Dec 01, 2011 6:23 pm
by NicC
Suggest you read the first post in the topic. Or...analyse the code. If you cannot do the latter then do not try to use this.