Page 1 of 1

complicated deleting duplicates in dataset

PostPosted: Thu Jun 02, 2022 10:21 pm
by cobol_dev
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.

Re: complicated deleting duplicates in dataset

PostPosted: Fri Jun 03, 2022 2:49 am
by sergeyken
1. This is not JCL. Use SORT instead.

2. Learn how to use the Code button when posting your code/data samples.