Page 1 of 1

Finding a string in the pds members

PostPosted: Fri Jun 15, 2012 5:46 pm
by jvinoth
Hi,
I need to search for a string like 'pgm=sort' in the pds members.
if that string found i need to write the proc name into seperate file using REXXplease tell me how to do this.

Re: Finding a string in the pds members

PostPosted: Fri Jun 15, 2012 5:47 pm
by jvinoth
Need to wite the list of members which has the string like that and need to write the only member name into the other file.

Re: Finding a string in the pds members

PostPosted: Fri Jun 15, 2012 6:04 pm
by Akatsukami
Your post is incoherent:
  1. Justify why SRCHFOR cannot be used.
  2. Where is the PDS name supposed to come from?
  3. What is
    Need to wite the list of members which has the string like that and need to write the only member name into the other file.
    supposed to mean?

Re: Finding a string in the pds members

PostPosted: Fri Jun 15, 2012 6:57 pm
by jvinoth
if it finds the pgm=sort string..ya we can do using srchfor and also 3.14 option.but trying to write in rexx

Re: Finding a string in the pds members

PostPosted: Fri Jun 15, 2012 8:04 pm
by Ed Goodman
Try this:
- Run SRCHFOR in batch.
- examine the JCL that is created
- add alloc/free commands to your rexx
- run the rexx

Something like this:
   /* NOW CALL IDCAMS TO PROCESS IT */                               
                                                                     
   "ALLOC DDNAME(SYSOUT) DSNAME('*')"                                 
   "ALLOC DDNAME(SYSDBOUT) DSNAME('*')"                               
   "ALLOC DDNAME(SYSUDUMP) DSNAME('*')"                               
   "ALLOC DDNAME(AMSDUMP) DSNAME('*')"                               
   "ALLOC DDNAME(SYSABEND) DSNAME('*')"                               
   "ALLOC DDNAME(SYSPRINT) DSNAME('*')"                               
   "ALLOC DDNAME(SYSIN) DSNAME('WTSO.WNEG.SYSIN') SHR"               
                                                                     
 "CALL 'SYS1.LINKLIB(IDCAMS)'"                                       
                                                                     
   COMPILER_RC=RC                                                     
  "FREE DD(SYSOUT,SYSDBOUT,SYSUDUMP,AMSDUMP,SYSABEND,SYSPRINT,SYSIN)"
  "DELETE ('WTSO.WNEG.SYSIN') NONVSAM"                               


This is running IDCAMS, but you get the picture.