complicated deleting duplicates in dataset



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

complicated deleting duplicates in dataset

Postby cobol_dev » Thu Jun 02, 2022 10:21 pm

hey folks, have no idea to this problem:

input like
a1234 10 22,34
a1234 10 7,34
a1234 10 22,34
a1234 100 -22,34

wished output
a1234 10 22,34
a1234 10 7,34

the task is: if i found a positive amount to the key 10 and the same amount negative to key 100 both records should be eliminted. if there is any other record with the key 10 with the same amount it should be also in the output record. the task is finding siblings wiht key 10 and 100 which results by arithmetic add function to null. in my example 22,34 + (-22,34) results in 0 and the first record 22,34 and the second record 7,34 should be in the output file. so any icetool or dfsort command isn't the resolution. I think it must be a combination of more steps but i have no idea.
cobol_dev
 
Posts: 7
Joined: Wed Apr 13, 2022 11:48 pm
Has thanked: 1 time
Been thanked: 0 time

Re: complicated deleting duplicates in dataset

Postby sergeyken » Fri Jun 03, 2022 2:49 am

1. This is not JCL. Use SORT instead.

2. Learn how to use the Code button when posting your code/data samples.
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 408
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 6 times
Been thanked: 40 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post