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
 

 

COBOL Program to Read two Infiles

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
raj4neo
Warnings : 1

New User


Joined: 12 May 2006
Posts: 49
Location: India

PostPosted: Tue Sep 15, 2015 4:37 am    Post subject: COBOL Program to Read two Infiles
Reply with quote

Hi ,

I have a Requirement of two read two input files

File A have Record Layout I1 I2 , I3 , I4 , I5 , I6 where I4 , I5 , I6 Is of Array data having 5 occurs

File A have Record Layout I1 I7 , I8 , I9 , I10 , I11 where I7 , I8 , I9 , I10, 1II Is of Array data having 20 occurs

I HAVE TO MATCH THE I1 in both file and write the output layout as

O1 , O2 , O3 , O4 , O5 , O6 , O7 ,O8,O9,O10,O11 , ALL THE OUTPUT ARRAY FILED 04-011 SHOULD HAVE ONLY ARRAY OF 5 OCCURS

could you please let know any sample code

Thanks in advance
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Tue Sep 15, 2015 5:08 am    Post subject:
Reply with quote

I have never heard of sample code for such a requirement -- so basically you are asking for us to give you the code. This is a HELP forum, not a WRITE-THE-CODE-FOR-YOU forum. If / when you have specific questions about specific problems, post them and we will (usually) be able to help.

Questions I would be asking:
1. Are the files sorted by I1 already?
2. What are the I1, I2, ... ? Are they separate records (and if so, how are records identified?)? If not, does every record have the same data (that is, does every record of file A have I1, I2, I3, I4, I5, I6 in sequence or can one -- or more -- of them be missing)?
3. What are the record lengths for file A, file B, and the output file?
Back to top
View user's profile Send private message
raj4neo
Warnings : 1

New User


Joined: 12 May 2006
Posts: 49
Location: India

PostPosted: Tue Sep 15, 2015 5:57 am    Post subject:
Reply with quote

I am not asking for Full code

Yes Both the Input files are in Sorted order

First File is having the Lrecl 5662 FB FORMAT

Second file is having the Lrecl 9000 FB Format

I1 is the Key Record and

I1 / I2 ARE THE SEPERATED RECORDS
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 331
Location: USA

PostPosted: Tue Sep 15, 2015 7:23 am    Post subject: Reply to: COBOL Program to Read two Infiles
Reply with quote

Only If you had 'Googled', you would have got plenty of "sample codes" icon_evil.gif

You can do it even now and after that, as Robert suggested, come back with specifics of the issues you face.

.
Back to top
View user's profile Send private message
raj4neo
Warnings : 1

New User


Joined: 12 May 2006
Posts: 49
Location: India

PostPosted: Tue Sep 15, 2015 7:28 am    Post subject: Reply to: COBOL Program to Read two Infiles
Reply with quote

Oh OK
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Tue Sep 15, 2015 7:43 am    Post subject:
Reply with quote

It sounds like you need to sit down and work through what to do -- create some test records for file A and file B (with matches on I1 and non-matches on I1), and manually use pen and paper to walk through what should happen. This can be a VASTLY helpful exercise as it gives you a feel for what the logic needs to be. Things to be resolved:
- what if an I1 in file A does not have a match in file B?
- what if an I1 in file B does not have a match in file A (usually the same thing but sometimes not)?
- how long will the output record be?
- how many records in file A and B? How many output records do you expect from those records?

Many programmers tend to start coding way too early, before they fully understand the data to be processed. When this happens, they either have to scrap some of what they've written and write correct code (which often they don't want to do after investing the time in the code), or (FAR more frequently) they attempt to shoehorn the written code into the needed process, causing continuing issues since the code doesn't really fit the data.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Wed Sep 16, 2015 2:40 am    Post subject:
Reply with quote

I could get nothing. Please give us sample input,output . This is so high level.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1715
Location: UK

PostPosted: Wed Sep 16, 2015 1:46 pm    Post subject:
Reply with quote

Sounds like a standard 2-file match
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Wed Sep 16, 2015 2:14 pm    Post subject: Reply to: COBOL Program to Read two Infiles
Reply with quote

Yes, Nic, to me also. Even if a modified one (the the subsequent records don't have a key).

Depending on whether the tables (COBOL doesn't have arrays) coincide, chopping down 20 to five may be simple. But, we can't tell.
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 I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 12 Tue Dec 06, 2016 8:30 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts COBOL Version 6.1 Virendra Shambharkar COBOL Programming 5 Tue Nov 01, 2016 11:24 am


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