View previous topic :: View next topic
|
Author |
Message |
anuvrat
New User
Joined: 20 Jun 2007 Posts: 5 Location: Chennai
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
anuvrat
New User
Joined: 20 Jun 2007 Posts: 5 Location: Chennai
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
anuvrat
New User
Joined: 20 Jun 2007 Posts: 5 Location: Chennai
|
|
|
|
Do you have a process in mind?
If yes then please share it, it will help me tremendously.
Thanks |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
anuvrat
New User
Joined: 20 Jun 2007 Posts: 5 Location: Chennai
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
Back to top |
|
|
anuvrat
New User
Joined: 20 Jun 2007 Posts: 5 Location: Chennai
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
|