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 

Code to search multiple PDS for a string !!
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
amit4u79
Beginner


Joined: 24 Oct 2005
Posts: 109
Topics: 36
Location: India

PostPosted: Wed Nov 02, 2005 4:54 am    Post subject: Code to search multiple PDS for a string !! Reply with quote

Hi, I went thru the Forum posts for how REXX can be used to search PDS member list for a string. But I am facing a different issue altogether.

I have an input file which contains a big list of PDS. I have to code a REXX which reads this input file, takes the name of all the PDSes and searches the PDSes members for a specific string. The result would then be something like "string xxx was found in member yyy of PDS zzzzz".

I saw various posts related to SEARCH but none of them is satisfying this criteria. Or if at all I have missed any post which has this already discussed, a pointer would be useful.

Thanks,
Amit Joshi
Singapore.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Wed Nov 02, 2005 5:03 am    Post subject: Reply with quote

Amit,

I don't think that Searching PDSes using REXX is a good idea since it is very slow. Would you be interested for 3.14/3.15 (Super-C) Search instead. It also has support to execute the search in BATCH (JCL).

All you need to do is to concatenate all your PDSes in the NEWDD statement of ISRSUPC like this.

Code:

//*                                     
//SEARCH  EXEC PGM=ISRSUPC,             
//            PARM=(SRCHCMP,           
//            'NOPRTCC,LONGLN,IDPFX')   
//NEWDD  DD DSN=PDS1,             
//          DISP=SHR         
//       DD DSN=PDS2,     
//          DISP=SHR         
//       DD DSN=PDS3,     
//          DISP=SHR         
//       DD DSN=PDS4,     
//          DISP=SHR         
.....           
//OUTDD  DD SYSOUT=*                   
//SYSIN  DD *                           
SRCHFOR  '<search-string>'               
/*                                     


In This case, you can use REXX / SORT or any other utility program to read your input PS and generate a JCL with all PDSes concatenated as shown above and then submit it. This will be faster than a REXX.

Thanks,
Phantom


Last edited by Phantom on Wed Nov 02, 2005 5:47 am; edited 1 time in total
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Nov 02, 2005 5:09 am    Post subject: Reply with quote

Phantom,

If I remember correctly ISPF search option has a limit on the concatenation list which is believe is 4.

You may not get the right results if you exceed that limit.

Amit4u79, You can use File-aid to search for a string in multiple PDS's

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
amit4u79
Beginner


Joined: 24 Oct 2005
Posts: 109
Topics: 36
Location: India

PostPosted: Wed Nov 02, 2005 5:20 am    Post subject: Reply with quote

Hi Kolusu/Phantom,
Thanks for your input, yes Kolusu I am aware of the limit for ISRSUPC. If possible Kolusu can you provide me a Batch JCL which uses PGM FILEAID and all PDS and how to specify SEARCH string there. So then I can read the Input file containing list of PDS and file tailor my batch job thru the REXX execs.
Pls help.

Thanks,
Amit Joshi
_________________
I did not fail; I have found 10,000 ways that would not work - Albert Einstein.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Wed Nov 02, 2005 5:22 am    Post subject: Reply with quote

Phantom,

ISPF option 3.13 is used for comparing the datasets.
3.14 and 3.15 can be used for searching.

Quote:

If I remember correctly ISPF search option has a limit on the concatenation list which is believe is 4.


Kolusu,

Are you talking about the number strings or number of datasets.

Thru 3.13 we can search for only 1 string in only 1 dataset at at time.
Thru 3.14 we can search for 5 strings in only 1 dataset at at time.
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Nov 02, 2005 5:27 am    Post subject: Reply with quote

Quote:

possible Kolusu can you provide me a Batch JCL which uses PGM FILEAID and all PDS and how to specify SEARCH string there.


Amit4u79,

Check this link

http://www.mvsforums.com/helpboards/viewtopic.php?p=11705#11705

Quote:

Kolusu,

Are you talking about the number strings or number of datasets.

Thru 3.13 we can search for only 1 string in only 1 dataset at at time.
Thru 3.14 we can search for 5 strings in only 1 dataset at at time.


vkphani,

Your assumption is wrong. You can search more strings. The limits you specified are only applicable to interactive mode. In batch mode you can add many search strings.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Wed Nov 02, 2005 5:40 am    Post subject: Reply with quote

Kolusu,

Quote:

If I remember correctly ISPF search option has a limit on the concatenation list which is believe is 4.


Hmm...I never knew this or don't remember reading about this anywhere !!!. I use this search option very rarely. Thanks a lot for the update.

In this case, as you said FILEAID should be a better solution.

Thanks,
Phantom
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Wed Nov 02, 2005 5:46 am    Post subject: Reply with quote

VkPhani,

Quote:

ISPF option 3.13 is used for comparing the datasets.


Thanks for pointing this out. I never used the online screen to do the search, always go in for the batch option. I will edit my original post.

Thanks,
Phantom
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Wed Nov 02, 2005 5:51 am    Post subject: Reply with quote

Yes Kolusu.

These limits are only applicable to interactive mode.
But 3.13 and 3.14 are interactive options only right.
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Nov 02, 2005 6:03 am    Post subject: Reply with quote

Quote:

These limits are only applicable to interactive mode.
But 3.13 and 3.14 are interactive options only right.


vkphani,

Correction ! The search options are 3.14 and 3.15 ! 31.2 and 3.13 is superc and extended superc. All these options can be run in the batch mode.

Look at the bottom center of any of the panels(execuetion mode) mentioned above, you have an option of running in batch. Change the option to 2. The default is 1 which is foreground

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Wed Nov 02, 2005 6:08 am    Post subject: Reply with quote

vkphani,

Quote:

But 3.13 and 3.14 are interactive options only right.


Indeed yes. These are interactive screens. But if you say ISRSUPC, many people might not know what it is. Their online equivalents are more popular. Even guys who are new to mainframe can easily understand when these utilities by their online screens names.

If you look at my original post, you can see that I mentioned about their batch equivalent.
Quote:

It also has support to execute the search in BATCH (JCL).


Thanks,
Phantom
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Wed Nov 02, 2005 6:12 am    Post subject: Reply with quote

Thanks a lot for the info Kolusu.

I have never used these options in Batch mode.
I have learned a new thing.
Back to top
View user's profile Send private message Send e-mail
amit4u79
Beginner


Joined: 24 Oct 2005
Posts: 109
Topics: 36
Location: India

PostPosted: Thu Nov 03, 2005 10:45 pm    Post subject: Reply with quote

Hi Kolusu,
Thanks for the suggestion regarding using FILEAID. However, I am stuck with a different issue. The datasets I have in the concatenation list are of different LRECLs and so FILEAID issues an error when run in Batch.
Is there any parameter in Batch FILEAID which I can give to overcome the different LRECL issue. ISRSUPC works well with different LRECL PDS, but I am interested in using FILEAID because of limit of 4 concats with ISRSUPC.

Kolusu or someone, please help with this.
_________________
I did not fail; I have found 10,000 ways that would not work - Albert Einstein.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Thu Nov 03, 2005 11:20 pm    Post subject: Reply with quote

I can't find any documented restriction on SuperC's NEWDD (input) statement for search. I was able to search up to 51 concatenated data sets with the string found only in the last one.
Back to top
View user's profile Send private message Visit poster's website
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Thu Nov 03, 2005 11:34 pm    Post subject: Reply with quote

Quote:

Thru 3.13 we can search for only 1 string in only 1 dataset at at time.
Thru 3.14 we can search for 5 strings in only 1 dataset at at time.


vkphani,

I beleive you are referring to 3.14 and 3.15. In both the case you can search multiple strings.

3.14 -
Code:
Enter "/" to select option           
      Specify additional search string

3.15 -
Code:
Enter Search Strings and Optional operands (WORD/PREFIX/SUFFIX,C)         
      Caps . .                                                               
      Caps . .                                                               
      Caps . .                                                               
      Asis . .                                                               
      Asis . .                                                               

Regards,
Diba.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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