Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 252
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 FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us