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

Search of a keyword in all files with a qualifier


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
himanshu_gupta02

New User


Joined: 31 Jul 2006
Posts: 6

PostPosted: Fri Oct 05, 2007 1:42 am
Reply with quote

I want to search a word in all files starting with a particular qualifier. What is the method to do it.

To explain following example will help:-
Search Keyword "bank" in all files starting with Qualifier PLI0
So result shoould come like this:

All file names/files starting with PLI0 (e.g. PLI0.ABC.QAV) should be output which contain "bank" in them.

Kindly, reply
Back to top
View user's profile Send private message
himanshu_gupta02

New User


Joined: 31 Jul 2006
Posts: 6

PostPosted: Fri Oct 05, 2007 2:04 am
Reply with quote

Just to clarify.
I am looking at word "bank" in the data of the file and not in the name of the file.
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 Oct 05, 2007 2:22 am
Reply with quote

Hello himanshu_gupta02 and welcome to the forums,

Is this something you want to do in a COBOL program?

Is it ok to use multiple steps?

Do these files have similar dcb attributes or do they vary widely?

How much data will be in these files?
Back to top
View user's profile Send private message
himanshu_gupta02

New User


Joined: 31 Jul 2006
Posts: 6

PostPosted: Fri Oct 05, 2007 8:33 am
Reply with quote

Some files are VSAM and some are FLAT files.
Yes these files are on mainframe.

There would be around 1000 files.
The data shouldn't be too heavy.
Max 10K rows in any one of these files.

I don't know how to go about this.
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 Oct 05, 2007 8:52 am
Reply with quote

Hello,

What is the lrecl of the longest record?

If this were my requirement, i would look into getting all of the data into qsam files (easier to work with). When creating the qsam files, i'd make them all the same lrecl (as long as the longest record).

You can get a list of all of the files with the qualifier you want to use. The list can be used to generate jcl to do the creation of the qsam files. The same list can be used to create a set of "break" records (each would have a 1-record file). The break record would have the file name as the only data.

Once all of the qsam files and all of the "break record" files were created, i would generate several sets of jcl (due to the number of dd statements restriction) to interleave a break record file and the corresponding data file into a long concatenation.

Your code would read the concatenated files, keeping track of which file is in process by the "break record" entries and as the data was read, it would be scanned for your "bank" value and when found, an output list would be created for that "hit".
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
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
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
Search our Forums:

Back to Top