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 match file1 and file2

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

Active User


Joined: 13 Jul 2005
Posts: 136

PostPosted: Thu Aug 02, 2007 11:18 am    Post subject: Cobol program to match file1 and file2
Reply with quote

Dear All,

I want to write cobol program and I am expecting code or step by step procedure

Please help me out and find my query

File1
2000

File2
100
200
400
500
600
700

I have two input file File1 and File2. I need to match file1 and file2

here File1 have 2000.

Now I want to sum (100 + 200 ) .If its matching file1 and file2 else

I need do (100+200+300 ) .If its not matching else

.......

etc ....

like ,I need to do match all input file2.


My my output should be
output 1
200
500
600
700

or
output 2
100
200
400
600
700


My output should be come Output 1 records or output 2 records.
Back to top
View user's profile Send private message

balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 130
Location: Guntur

PostPosted: Thu Aug 02, 2007 6:54 pm    Post subject:
Reply with quote

hi vicky,


Can you explain the sum function clearly so that we can provide you the code.
Quote:

I have two input file File1 and File2. I need to match file1 and file2

here File1 have 2000.

Now I want to sum (100 + 200 ) .If its matching file1 and file2 else

I need do (100+200+300 ) .If its not matching else

.......

etc ....
Back to top
View user's profile Send private message
kgumraj2

New User


Joined: 01 Aug 2007
Posts: 42
Location: Hyderabad

PostPosted: Thu Aug 02, 2007 7:04 pm    Post subject:
Reply with quote

Hi,

Are you only checking for equal or greater than also,
Please do provide this information also. Thanks.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Aug 03, 2007 12:09 am    Post subject:
Reply with quote

Hello,

Please look at this similar topic.
http://ibmmainframes.com/viewtopic.php?t=22885

As i posted in that topic, this sounds like the "classic" accounts receivable "cash application" process. Invoices are paid when an exact match is found or if the total of multiple invoices equals a payment.

If your requirement is similar, you need to clearly define all of the processing rules before you begin coding.

Unless this is a school project and the requirements are less confining.
Back to top
View user's profile Send private message
Raphael Bacay

New User


Joined: 04 May 2007
Posts: 58
Location: Manila, Philippines

PostPosted: Fri Aug 03, 2007 8:47 am    Post subject: Re: Cobol program to match file1 and file2
Reply with quote

Hello,

Can you explain the matching algorithm again? It is a little fuzzy.

Regards.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Aug 03, 2007 6:20 pm    Post subject:
Reply with quote

Hello,

The cash application algorithm will be very fuzzy until all of the business rules are defined (even then it is usually not trivial). Only when all of the rules are known, might the code be written.

If you post all of the rules, we may be able to help.
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 XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm


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