Page 1 of 1

search string in VSAM files

PostPosted: Thu Aug 23, 2007 3:03 pm
by kamal
If I need to search a string in 20 vsam files...is there any command to do so

Re: search string in VSAM files

PostPosted: Thu Aug 23, 2007 3:35 pm
by CICS Guy
I assume you mean a string anywhere in these VSAM records, I can't see a way other than writing a program to do it.....
Have you looked into the manual Frank pointed you to regarding DFSORT's PARSE? The STARTAT=string operand might be able to do it.....

Re: search string in VSAM files

PostPosted: Thu Aug 23, 2007 9:04 pm
by Frank Yaeger
I need to search a string in 20 vsam files


Search a string and do what exactly if you find it?

Re: search string in VSAM files

PostPosted: Fri Aug 24, 2007 9:27 am
by kamal
All the VSAM files are of same layout.
There's a field V-NAME PIC x(32).
I need to search value 'JIMI$ADAMS' in V-NAME fileds in all 20 VSAM files...

As in PS files we use SRCHFOR 'JIMI$ADAMS' ...

Re: search string in VSAM files

PostPosted: Fri Aug 24, 2007 12:16 pm
by William Thompson
kamal wrote:All the VSAM files are of same layout.
There's a field V-NAME PIC x(32).
I need to search value 'JIMI$ADAMS' in V-NAME fileds in all 20 VSAM files...

As in PS files we use SRCHFOR 'JIMI$ADAMS' ...
So the string will be in the same location in every record?
Again, what will you do with this string when you find it?

Re: search string in VSAM files

PostPosted: Sat Aug 25, 2007 11:13 am
by kamal
what will you do with this string when you find it?


Actually we have a Unique-ID which can be present in any one of these 20 different VSAM files.
For some reason I want to search one particular Unique-ID say 'xxxxxxxx' in these files.
I need to get the VSAM file NAME in which the Unique-ID is present.
In all files the Unique-ID is present at pos 1-8.

I just want to know is there any easy way to serch strings in VSAM ; like SRCHFOR for PS datasets.

Otherwise I could use SORT/Cobol to achieve this.
Thanks for your response(s) all.