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

Search for a value in multiple files


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chiraag

New User


Joined: 19 Apr 2005
Posts: 7

PostPosted: Thu Mar 29, 2007 9:32 am
Reply with quote

I need to search for few strings in hundreds of Physical Sequential files. Tedious way is to open up the file and search the string using Find function. this is very time consuming. All the files are variable record lengths and the string that I need to search can occur at any position.
Also I need to search for multiple strings and not just one.

Can someone help ?
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Thu Mar 29, 2007 9:55 am
Reply with quote

Quote:
I need to search can occur at any position.


For searching a value in the record, you can use SS format as in -

Code:
INCLUDE COND=(1,80,SS,EQ,C'FIRSTCOND',OR,
                                    1,80,SS,EQ,C'SECONDCOND') * lrecl=80


Since you also said all a variable file, I believe you need to use one step for one file (huh... tedious proces again for writing the JCL).
Back to top
View user's profile Send private message
chiraag

New User


Joined: 19 Apr 2005
Posts: 7

PostPosted: Thu Mar 29, 2007 10:03 am
Reply with quote

They are variable blocked records but with same LRECL. Also does the above help to search the entire file or only certain columns?
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Thu Mar 29, 2007 10:06 am
Reply with quote

Format SS searches in the entire record (i.e., from coulmn 1 to n). So even if you dont know the column value, give the max lrecl in the control card. That should do the trick.
Back to top
View user's profile Send private message
chiraag

New User


Joined: 19 Apr 2005
Posts: 7

PostPosted: Thu Mar 29, 2007 10:29 am
Reply with quote

This is what I gave:

//SYSIN DD *
INCLUDE COND=(1,26620,SS,EQ,C'RP121PSB')
/*

and it gives me the below error

SYSIN :
INCLUDE COND=(1,26620,SS,EQ,C'RP121PSB')
*
WER251A INCL INVALID LENGTH
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Thu Mar 29, 2007 10:32 am
Reply with quote

Code:
//SYSIN DD *
   SORT FIELDS=COPY
   INCLUDE COND=(1,26620,SS,EQ,C'RP121PSB')
/*


Use the above sort card.
Back to top
View user's profile Send private message
chiraag

New User


Joined: 19 Apr 2005
Posts: 7

PostPosted: Thu Mar 29, 2007 10:40 am
Reply with quote

This option gave me the same error. Do I need to convert the VB file to FB file before I can use search string?
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Thu Mar 29, 2007 2:08 pm
Reply with quote

Chiraag,

I had used SS on FB file before and not with VB. Could it be possible for you convert the VB file to FB first in step1 followed by search in step2?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Mar 30, 2007 12:03 am
Reply with quote

Hello,

You are using Syncsort, therefore many of the DFSORT "tricks" will not be available.

Did your process work when you added the
Code:
   SORT FIELDS=COPY
icon_question.gif
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top