Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Search for a value in multiple files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Search for a value in multiple files
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: 1439
Location: Bangalore,India

PostPosted: Thu Mar 29, 2007 9:55 am    Post subject:
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    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Thu Mar 29, 2007 10:06 am    Post subject:
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    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Thu Mar 29, 2007 10:32 am    Post subject:
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    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Thu Mar 29, 2007 2:08 pm    Post subject:
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

Site Director


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

PostPosted: Fri Mar 30, 2007 12:03 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Data replication from multiple Db2 ta... kishpra DB2 5 Mon Mar 27, 2017 9:58 pm
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts Calling procedure with multiple entri... steve-myers PL/I & Assembler 5 Fri Jan 27, 2017 3:33 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us