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

Cobol program to match file1 and file2


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 128
Location: Guntur

PostPosted: Thu Aug 02, 2007 6:54 pm
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
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

Moderator Emeritus


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

PostPosted: Fri Aug 03, 2007 12:09 am
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
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

Moderator Emeritus


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

PostPosted: Fri Aug 03, 2007 6:20 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top