how to process mutiple input files?



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

how to process mutiple input files?

Postby leon » Sun Nov 30, 2008 11:44 pm

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.
leon
 
Posts: 40
Joined: Tue Nov 25, 2008 7:39 pm
Has thanked: 0 time
Been thanked: 0 time

Re: how to process mutiple input files?

Postby dick scherrer » Mon Dec 01, 2008 12:46 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: how to process mutiple input files?

Postby leon » Mon Dec 01, 2008 8:45 am

//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.
leon
 
Posts: 40
Joined: Tue Nov 25, 2008 7:39 pm
Has thanked: 0 time
Been thanked: 0 time

Re: how to process mutiple input files?

Postby dick scherrer » Mon Dec 01, 2008 9:02 am

Hello,

Yes, to your program it will appear as a single file. One open, all of the reads until "at end", and one close.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post