Page 1 of 1

COBOL program to compare two files and write a report

PostPosted: Thu Oct 09, 2014 2:04 am
by pradi24
Hi, I am working on a cobol program. I need some inputs on structuring my logic in order to achieve the required output.

Requirements -
Program Inputs -
1 Flat file (80 bytes), Contains - Page-No, Page-length, Page-offset
1 XML file, Contains - multiple elements, like ReportID, PostingDate, Indexfield, Indexvalue, Page-No

Output - Write out a report,

Condition -
I need to read the Page No from xml-file and compare the same in the flat file. If there is a match then write out a report by reading xml elements.
- few consideration: in the XML file there can be more than 1 row with same page no and I need to account all of them while writing the report.

For ex; From XML I have Page No=1 (I have 2 entries for Page NO=1 in the xml)
There is a matching entry in the flat file and I need to write the report.

Can you advise what is best way to implement the logic for my requirement?

Re: COBOL program to compare two files and write a report

PostPosted: Thu Oct 09, 2014 2:55 am
by NicC
look at the 2-file match "sticky" at the top of this setion of the forum.

Re: COBOL program to compare two files and write a report

PostPosted: Fri Jul 06, 2018 1:59 am
by kakka31
looking for the 2-file match sticky

Re: COBOL program to compare two files and write a report

PostPosted: Fri Jul 06, 2018 2:19 am
by Robert Sample
If you click on IBM Cobol next to PROGRAMMING LANGUAGES above, you will get a list of all the posts in the topic. The first one is the two-file match; it can also directly be retrieved at ibm-cobol/file-match-merge-sample-code-t881.html