IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Search string in multiple PS datasets


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Mar 26, 2009 5:13 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Mar 26, 2009 5:35 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Mar 26, 2009 6:28 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Mar 26, 2009 6:45 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Mar 26, 2009 7:01 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
Search our Forums:

Back to Top