Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
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".