View previous topic :: View next topic
|
Author |
Message |
himanshu_gupta02
New User
Joined: 31 Jul 2006 Posts: 6
|
|
|
|
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 |
|
|
himanshu_gupta02
New User
Joined: 31 Jul 2006 Posts: 6
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
himanshu_gupta02
New User
Joined: 31 Jul 2006 Posts: 6
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|