COBOL program to compare two files and write a report



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

COBOL program to compare two files and write a report

Postby pradi24 » Thu Oct 09, 2014 2:04 am

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?
pradi24
 
Posts: 1
Joined: Thu Oct 09, 2014 1:55 am
Has thanked: 0 time
Been thanked: 0 time

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

 

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

Postby NicC » Thu Oct 09, 2014 2:55 am

look at the 2-file match "sticky" at the top of this setion of the forum.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2805
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 115 times

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

Postby kakka31 » Fri Jul 06, 2018 1:59 am

looking for the 2-file match sticky
kakka31
 
Posts: 1
Joined: Fri Jul 06, 2018 1:53 am
Has thanked: 0 time
Been thanked: 0 time

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

Postby Robert Sample » Fri Jul 06, 2018 2:19 am

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
Robert Sample
Global moderator
 
Posts: 3519
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 250 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post