View previous topic :: View next topic
|
Author |
Message |
Mohan Makana
New User
Joined: 07 Feb 2006 Posts: 18
|
|
|
|
Hi,
Could any,please let me know how to handle different input files in one single COBOL program?.
My Cenario is : My program receives different formatted input files,with different lengths for different batch runs. I have to process all these files in my program and have to generate a report basing on some condition.
Thanks,
Mohan. |
|
Back to top |
|
|
rajandhla
Active User
Joined: 18 Oct 2005 Posts: 182 Location: Luton UK
|
|
|
|
Can you please be clear what are the different formats you receive and the what processing doing in the code to generate the reportt.....
Regards
jayaram |
|
Back to top |
|
|
Mohan Makana
New User
Joined: 07 Feb 2006 Posts: 18
|
|
|
|
Please forget about the process. Here my question is how can we handle the input files in the single COBOL program coming in different layouts.
i.e.
I/P File 1 Layout:
Field A PIC X(5)
Field B PIC X(20)
Field C PIC X(40).
I/P File 2 Layout:
Field K PIC X(5)
Field L PIC X(15)
Field M PIC X(20)
I/P file 3 Layout:
.......
.......
....... |
|
Back to top |
|
|
rajandhla
Active User
Joined: 18 Oct 2005 Posts: 182 Location: Luton UK
|
|
|
|
yeah, you mean here you will a single file daily with different layouts for every batch run....
or
you will receive multiple files with different formats..
regards
jai |
|
Back to top |
|
|
radhakrishnan82
Active User
Joined: 31 Mar 2005 Posts: 435 Location: chennai, India
|
|
|
|
If your JCL is considering one single input then
use
SELECT OPTIONAL filename in FILE CONTROL of COBOL.
It considers the filename according to the ddname used in different JCL's running the same program.
Hope this helps. |
|
Back to top |
|
|
shreevamsi
Active User
Joined: 23 Feb 2006 Posts: 305 Location: Hyderabad,India
|
|
|
|
Hi Mohan,
If your shop has Eazytrieve, Then that is more feasible than COBOL to format inputs to genarete reports.
~Vamsi |
|
Back to top |
|
|
dneufarth
Active User
Joined: 27 Apr 2005 Posts: 419 Location: Inside the SPEW (Southwest Ohio, USA)
|
|
|
|
are the records fixed or variable length?
is there a common field in the records that allow you to determine which layout to use? |
|
Back to top |
|
|
Muthukumar.PLindia
New User
Joined: 03 Jul 2006 Posts: 51 Location: Chennai
|
|
|
|
HI mohan,
If you want to call your subprogram only once for processing all the records in the input file means, then i think you can do like this
1. Read all the data in an array
2. pass this array as a linkage parameter to the suprogram
3. In the procedure division you can recieve the array and process one by one.. |
|
Back to top |
|
|
Muthukumar.PLindia
New User
Joined: 03 Jul 2006 Posts: 51 Location: Chennai
|
|
|
|
Muthukumar.PLindia wrote: |
HI mohan,
If you want to call your subprogram only once for processing all the records in the input file means, then i think you can do like this
1. Read all the data in an array
2. pass this array as a linkage parameter to the suprogram
3. In the procedure division you can recieve the array and process one by one.. |
sorry. this has been posted for previous topic.. plz ignore this |
|
Back to top |
|
|
|