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: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post