How can i search a character string in all the generations of a GDG dataset at once.Any code,utility will do?

Showing Answers 1 - 5 of 5 Answers

srilkrishy

  • Aug 25th, 2006
 

Hi,

You can use a SS range option available in the SORT tool to get the records that fall on a particular criteria.

Foe exapmle,If you want to search the sting 'aaa' from the i/p file in between the colums 5 to 30,you need to code the SYSIN of the sort like below.

Include cond=(5,25,ss,eq,c'abc').

25 is the differnece between the 30 and 5 (ie the total lenght of between 2 columns)

Since you want to get the details from the GDG ,You need to keep the SORT in file with out the generation group.

For example,you are having the GDG version like,

AAA.BBB.CCC.G00V001

AAA.BBB.CCC.G00V002

AAA.BBB.CCC.G00V003

Then your sort in will be

AAA.BBB.CCC

Please let me know if you need the complete code of the JCL.

Thank you

Krishy

  Was this answer useful?  Yes

Sanjay

  • Feb 15th, 2007
 

As srilkrishy said if you want to search for 'aaa' the following would be the code..//**********************************************************************//*****THIS JCL WILL SEARCH THE STRING IN GIVEN PDS******//********************************************************************** //SEARCH EXEC PGM=ISRSUPC, // PARM=(SRCHCMP, // '') //NEWDD DD DSN=AAA.BBB.CCC.G00V001, // DISP=SHR //* DD DSN=AAA.BBB.CCC.G00V002, //* DISP=SHR //* DD DSN=AAA.BBB.CCC.G00V003, //* DISP=SHR //OUTDD DD SYSOUT=(*) //SYSIN DD * SRCHFOR 'aaa'/* correct me if i am wrong with regards...

  Was this answer useful?  Yes

If youre question is how to pull in all gens, simply code the GDG base without any absolute or relative reference.

To search for a string in a dataset, you can use, DFSORT, ICETOOL, SAS, etc.  There are many, many ways of doing it.
It would help if you narrowed your question to "How do I do this using DSSORT?"

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions