Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Search string in multiple PS datasets

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
anuvrat

New User


Joined: 20 Jun 2007
Posts: 5
Location: Chennai

PostPosted: Thu Mar 26, 2009 5:10 pm    Post subject: Search string in multiple PS datasets
Reply with quote

Hi!
I need to search a string in multiple PS datasets.
I know the first two qualifiers of the PS datasets 'D966.KACSQ' but do not know the rest of the qaulifiers and it can be anything.
Eg. I want to search 'sunday' in all the datasets that start with D966.KACSQ.*
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Thu Mar 26, 2009 5:13 pm    Post subject: Reply to: Search string in multiple PS datasets
Reply with quote

You cannot do it in a single shot ( vanilla environment )

You need multiple passes
- build the dataset list
- use the list to build the jcl for the utility You will use for the search ( sort os srchfor )
and submit the same
Back to top
View user's profile Send private message
anuvrat

New User


Joined: 20 Jun 2007
Posts: 5
Location: Chennai

PostPosted: Thu Mar 26, 2009 5:31 pm    Post subject:
Reply with quote

Thanks enrico for the quick reply.

My understanding is
1.Get the list of all the dataset names for the qualifiers.

The JCL that is generated by the 3.14 search option is
//SEARCH EXEC PGM=ISRSUPC,
// PARM=(SRCHCMP,
// 'ANYC')
//NEWDD DD DSN=psname,
// DISP=SHR
//OUTDD DD DSN=outputname,
// DISP=(NEW,CATLG),UNIT=SYSDA,
// SPACE=(27930,(50,100),RLSE),
// DCB=(BLKSIZE=27930)
//SYSIN DD *
SRCHFOR 'string'
/*

Add all the PS names in the NEWDD DSN list.

But there is a catch, what if the number of datasets with D966.KACSQ.* are lot (say 1000), this process will become very cumbersome.

Is there a shortcut to do this?

Thanks
Anuvrat
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Thu Mar 26, 2009 5:35 pm    Post subject: Reply to: Search string in multiple PS datasets
Reply with quote

if the process is well designed, the number of dataset involved will not make any difference

just the elapsed will be different
Back to top
View user's profile Send private message
anuvrat

New User


Joined: 20 Jun 2007
Posts: 5
Location: Chennai

PostPosted: Thu Mar 26, 2009 5:47 pm    Post subject:
Reply with quote

Do you have a process in mind?

If yes then please share it, it will help me tremendously.

Thanks
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Thu Mar 26, 2009 6:28 pm    Post subject: Reply to: Search string in multiple PS datasets
Reply with quote

the process will be different if You only wanted to know if the string is there or not
or You want the details ( line/record number )

-process only the return code or process the srchfor output dataset

but, what is the business need ??
Back to top
View user's profile Send private message
anuvrat

New User


Joined: 20 Jun 2007
Posts: 5
Location: Chennai

PostPosted: Thu Mar 26, 2009 6:40 pm    Post subject:
Reply with quote

I just want to know the PS names that contain the particular string.

eg..I want to know the names of the PS in the list 'D966.KACSQ.*' that contain the server name say 'ServerX'

The line number is not required.

Thanks
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Thu Mar 26, 2009 6:45 pm    Post subject: Reply to: Search string in multiple PS datasets
Reply with quote

I asked for a real business need,
after You have found that 748 datasets out of 1639
contain the string, what action are You going to take ?

given the real requirement there might be alternatives

is it going to be a repetitive task or one in a time ?

before spending my time I want to know why icon_cool.gif
Back to top
View user's profile Send private message
anuvrat

New User


Joined: 20 Jun 2007
Posts: 5
Location: Chennai

PostPosted: Thu Mar 26, 2009 6:55 pm    Post subject:
Reply with quote

There is going to be a server name change. Migration from server A to server B
So I need to find which all the instances of the server name in the datasets 'D966.KACSQ.*' list.

Suppose if the old server name is A, I need to change to B but I do not know which all PS are impacted and need to find out that.

Once I get the list of the impacted datasets, I need to change all instances of A to B.

This is a once in a while requirement, but the process that can be followed for this can be used for any changes like that in future.

Thanks
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Thu Mar 26, 2009 7:01 pm    Post subject: Reply to: Search string in multiple PS datasets
Reply with quote

I would go for a script to invoke an edit macro with two options
scan and change

I' ll see if I can find something around
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DUMP DATASETS VS TRACE DATASETS! lind sh CICS 4 Tue Dec 06, 2016 11:31 pm
No new posts Single COPY CICS TS datasets and when... Kyle Carroll CICS 2 Tue Oct 11, 2016 9:47 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Random Password (in string format) ge... ezhavendhan COBOL Programming 10 Mon Aug 29, 2016 3:18 pm
No new posts How to insert a lengthy string havin... vidyaa DB2 7 Thu Aug 25, 2016 5:20 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us