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 of a keyword in all files with a qualifier

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Search of a keyword in all files with a qualifier
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    Post subject: Search of a keyword in all files with a qualifier
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

Site Director


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

PostPosted: Fri Oct 05, 2007 2:22 am    Post subject:
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    Post subject: Reply to: Search of a keyword in all files with a qualifier
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

Site Director


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

PostPosted: Fri Oct 05, 2007 8:52 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm
No new posts Adding records from two files into on... shiitiizz SYNCSORT 4 Mon Sep 19, 2016 8:41 pm


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