IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to handle different formatted input files?


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Mohan Makana

New User


Joined: 07 Feb 2006
Posts: 18

PostPosted: Wed Jul 12, 2006 5:47 pm
Reply with quote

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
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Wed Jul 12, 2006 6:47 pm
Reply with quote

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
View user's profile Send private message
Mohan Makana

New User


Joined: 07 Feb 2006
Posts: 18

PostPosted: Wed Jul 12, 2006 6:59 pm
Reply with quote

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
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Wed Jul 12, 2006 8:11 pm
Reply with quote

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
View user's profile Send private message
radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 435
Location: chennai, India

PostPosted: Thu Jul 13, 2006 10:22 am
Reply with quote

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
View user's profile Send private message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Thu Jul 13, 2006 11:27 am
Reply with quote

Hi Mohan,

If your shop has Eazytrieve, Then that is more feasible than COBOL to format inputs to genarete reports.

~Vamsi
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 419
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Thu Jul 13, 2006 8:36 pm
Reply with quote

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
View user's profile Send private message
Muthukumar.PLindia

New User


Joined: 03 Jul 2006
Posts: 51
Location: Chennai

PostPosted: Sat Jul 15, 2006 1:47 pm
Reply with quote

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
View user's profile Send private message
Muthukumar.PLindia

New User


Joined: 03 Jul 2006
Posts: 51
Location: Chennai

PostPosted: Sat Jul 15, 2006 1:54 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
Search our Forums:

Back to Top