Page 1 of 1

Compare selected rows of 2 different file

PostPosted: Wed May 12, 2021 3:23 am
by Tesa
Hi All,

This is my requirement , let me know if anyone has a solution for this.

I have 2 input files and I need to compare the total credit amount row in both the input files and if the amounts are matching then I should write the record into the output file as a single row.

INPUT FILE 1

005 CREDIT
010 CREDIT
015 CREDIT
TOTAL CREDIT AMOUNT1 : 123456.78

INPUT FILE 2
001 CREDITS
004 CREDITS
008 CREDITS
010 CREDITS
TOTAL CREDIT AMOUNT2 : 123456.78

OUTPUT FILE EXPECTED

TOTAL CREDIT AMOUNT1 : 123456.78,TOTAL CREDIT AMOUNT2 : 123456.78

Is this possible?
TIA

Regards,
Tesa

Re: Compare selected rows of 2 different file

PostPosted: Wed May 12, 2021 4:51 pm
by prino
And which idiot PHB has come up with this requirement? What's the flipping use of writing out totals when they're the same?????

Re: Compare selected rows of 2 different file

PostPosted: Wed May 12, 2021 11:42 pm
by Tesa
Hi Prino,

It's a typo , its actually not* matching.
I need to compare the total credit amount row in both the input files and if the amounts are not matching then I should write the record into the output file as a single row.

Re: Compare selected rows of 2 different file

PostPosted: Thu May 13, 2021 1:07 am
by sergeyken
The question is not related to JCL, not even a bit.

Hint: read about SORT utilities, DFSORT, and/or SYNCSORT

Neither of them is JCL!!!