Page 1 of 1

how to process mutiple input files?

PostPosted: Sun Nov 30, 2008 11:44 pm
by leon
hi,there
this is my first cobol project(batch), there are 6 master files(tax2003,tax2004, tax2005,
tax2006,tax2007,tax2008) need to be the same process as following:

reading all master files which are the same structure, and then
process the records meet criteria for each master file. the last
get counts which meet special criteria.

I have 2 idea for mutiple input files:

1: in Cobol, loop 6 times, each time process one input file,
at last, write the total counts to a output file.

2: using jcl, at first combine all 6 input files into a big input file,
and then just process the big input file in COBOL.

I have no experience for mainframe, I'm not sure above is correct, they
will work well or won't work, could you tell me one better choice you
know? I appreciate your help.

thanks.

Re: how to process mutiple input files?

PostPosted: Mon Dec 01, 2008 12:46 am
by dick scherrer
Hello,

Another alternative might be to concatenate all 6 input files (in the jcl for this program) which will allow the program to process them as "one big file" without the need to create the single combined file.

Something like:
 
//TAXINFO  DD DSN=TAX2003
//         DD DSN=TAX2004
//         DD DSN=TAX2005
etc.

Re: how to process mutiple input files?

PostPosted: Mon Dec 01, 2008 8:45 am
by leon
//TAXINFO DD DSN=TAX2003
// DD DSN=TAX2004
// DD DSN=TAX2005



thanks very much, if I use it as my run jcl, is my cobol code the same with it process just one
input file ? my means is if I just open the big input file and process, close the big input file just
like process one file.

Re: how to process mutiple input files?

PostPosted: Mon Dec 01, 2008 9:02 am
by dick scherrer
Hello,

Yes, to your program it will appear as a single file. One open, all of the reads until "at end", and one close.