MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Multiple Searches

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
naveen
Beginner


Joined: 03 Dec 2002
Posts: 90
Topics: 31

PostPosted: Tue Aug 05, 2003 6:29 am    Post subject: Multiple Searches Reply with quote

I want to search (thru batch ISPF 3.14 ,ISRSUPC pgm.) a string in all members of one pds and then search names of all the members which are appearing in this search's searchlist , in all members of another PDS. How this two process task can can be done in batch ,so that just after providing initial search string , I can get both search-result lists ?

Example :
1. I will first search string 'str' in pds MYID.PDS1. As a result of this search MYID.SRCHFOR.LIST1 will have name of all members in MYID.PDS1.
(Say MEM1,MEM2,MEM4,MEM6,MEM9)

2. Now I want search all strings MEM1,MEM2,MEM4,MEM6,MEM9 one by one in MYID.PDS2 and write the all search results in MYID.SRCHFOR.LIST2.

I want this 2 step process to be automated in one , in which I will just have to provide 'str' as search string and I can automatically get results in MYID.SRCHFOR.LIST1 and MYID.SRCHFOR.LIST2
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue Aug 05, 2003 9:17 am    Post subject: Reply with quote

Naveen,
The following Job will give you the desired results.

Code:

//SEARCH1 EXEC PGM=ISRSUPC,                                           *
//            PARM=(SRCHCMP,                                           
//            '')                                                     
//NEWDD   DD DSN=YOURID.PDS1,
//           DISP=SHR                                                   
//OUTDD   DD DSN=YOURID.SRCHFOR.LIST1,                                 
//           DISP=(NEW,CATLG,DELETE),                                   
//           UNIT=PROD,                                                 
//           SPACE=(CYL,(X,Y),RLSE)                                     
//SYSIN   DD *                                                         
SRCHFOR  'YOUR FIRST SEARCH STRING'
/*


Now add a sort step to create the dynamic SRCHFOR cards from the output of the first search.

Code:

//STEP10  EXEC PGM=SORT                                             
//SORTIN  DD DSN=YOURID.SRCHFOR.LIST1,                             
//           DISP=SHR                                               
//SORTOUT DD DSN=&T1,DISP=(,PASS),SPACE=(CYL,(2,1),RLSE),RECFM=FB   
//SYSOUT  DD SYSOUT=*                                               
//SYSIN  DD *                                                       
  SORT FIELDS=COPY                                                 
  INCLUDE COND=(41,15,CH,EQ,C'STRING(S) FOUND')                     
  OUTREC FIELDS=(C'SRCHFOR  ',X'7D',3,8,X'7D',80:X)                 
/*                                                                                           


Now use the output of the above sort card as sysin cards for the next search.

Code:

//SEARCH2 EXEC PGM=ISRSUPC,                                           *
//            PARM=(SRCHCMP,                                           
//            '')                                                     
//NEWDD   DD DSN=YOURID.PDS2,
//           DISP=SHR                                                   
//OUTDD   DD DSN=YOURID.SRCHFOR.LIST2,                                 
//           DISP=(NEW,CATLG,DELETE),                                   
//           UNIT=PROD,                                                 
//           SPACE=(CYL,(X,Y),RLSE)                                     
//SYSIN   DD DSN=&T1,DISP=OLD                                                         
/*


Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group