Compare selected rows of 2 different file

JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...
Tesa
Posts: 2
Joined: Wed May 12, 2021 2:57 am
Skillset: JCL,COBOL,CICS
Referer: Google

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

User avatar
prino
Posts: 641
Joined: Wed Mar 11, 2009 12:22 am
Skillset: PL/I - CICS - DB2 - IDMS - REXX - JCL, most in excess of three decades
Referer: Google
Location: Vilnius, Lithuania
Contact:

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

Tesa
Posts: 2
Joined: Wed May 12, 2021 2:57 am
Skillset: JCL,COBOL,CICS
Referer: Google

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.

User avatar
sergeyken
Posts: 458
Joined: Wed Jul 24, 2019 10:12 pm
Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
Referer: Internet search

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 and Pythons come and go, but JCL and SORT stay forever.


  • Similar Topics
    Replies
    Views
    Last post