Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to handle different formatted input files?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How to handle different formatted input files?
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    Post subject:
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    Post subject:
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    Post subject:
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: 436
Location: chennai, India

PostPosted: Thu Jul 13, 2006 10:22 am    Post subject:
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    Post subject: Re: How to handle different formatted input files?
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: 247
Location: Cincinnati OH USA

PostPosted: Thu Jul 13, 2006 8:36 pm    Post subject:
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    Post subject: Re: How to handle different formatted input files?
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    Post subject: Re: How to handle different formatted input files?
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Need input in Scheduling Benchwarmer CA Products 5 Tue Jun 06, 2017 1:44 am
No new posts getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us