Page 2 of 2

Re: Searchfor a string in 2 or 3 pds in rexx

PostPosted: Fri Aug 02, 2019 1:44 am
by willy jensen
if you really insist on asking for datasets, then something like this could be used, as NicC suggested instead of running the REXX multiple times:
member = 'IHASDWA'                              
 fds=''                                          
 do until fds<>''                                
   say 'Enter libname'                            
   pull ds                                        
   if ds='X' then exit 0                          
   if sysdsn("'"ds"("member")'")='OK' then fds=ds
   say member 'not found in' ds                  
   iterate                                        
 end                                              
 say member 'is in' fds

Re: Searchfor a string in 2 or 3 pds in rexx

PostPosted: Fri Aug 02, 2019 1:59 pm
by NicC
Or - outline program structure:-

stem of items to find
stem of places to look
Do to_find_index = 1 to max items to find
   Do places_index = 1 To max places to look
      If item in place
      Then Do
         Say found
         set places_index to max places to look
      End
   End
End
 


If this is just a coding exercise then this will do but if you really are looking in Endevor for places that items exist then Endevor has builtin utilities for doing this search.