Compare selected rows of 2 different file



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Compare selected rows of 2 different file

Postby Tesa » Wed May 12, 2021 3:23 am

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
Tesa
 
Posts: 2
Joined: Wed May 12, 2021 2:57 am
Has thanked: 0 time
Been thanked: 0 time

Re: Compare selected rows of 2 different file

Postby prino » Wed May 12, 2021 4:51 pm

And which idiot PHB has come up with this requirement? What's the flipping use of writing out totals when they're the same?????
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 617
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 28 times

Re: Compare selected rows of 2 different file

Postby Tesa » Wed May 12, 2021 11:42 pm

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.
Tesa
 
Posts: 2
Joined: Wed May 12, 2021 2:57 am
Has thanked: 0 time
Been thanked: 0 time

Re: Compare selected rows of 2 different file

Postby sergeyken » Thu May 13, 2021 1:07 am

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!!!
Javas come and go, but JCL stays forever.
User avatar
sergeyken
 
Posts: 207
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 3 times
Been thanked: 19 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post