Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us