Page 1 of 1

is it possible to read the next record for a condition

Posted: Tue Sep 01, 2015 9:50 pm
by six digit
I will like to know if is is possible to read the next record when we are using a syncsort (icetool) base on a certain condition.

Exemple of the input

sort key will be account nbr + descending record type + amount

Code: Select all

account nbr amount rec. type   Comment
11111111111   10   reversal    not in the output
11111111111   10   deposit     not in the output
33333333333   20   deposit     in the output
44444444444   15   deposit     in the output
55555555555   20   reversal    in the output because reversal not having same amount as the deposit
55555555555   10   deposit     in the output
66666666666   30   reversal    in the output no match``
When a reversal type is read, a deposit should follow with the same amount, in this case it both record the reversal and deposit should not be in the output file. It is possible the amount is not the same for the reversal and the deposit, in this case both record should be in the output file.

output

Code: Select all

33333333333 20 deposit

44444444444 15 deposit

55555555555 20 reversal

55555555555 10 deposit

66666666666 30 reversal
Thanks
[coded]

Re: is it possible to read the next record for a condition

Posted: Thu Sep 03, 2015 1:57 pm
by RahmatKhan
Hi,

What is LRECL and RECFM of the input file? Can there be duplicates in the input?

Re: is it possible to read the next record for a condition

Posted: Tue Sep 08, 2015 2:02 pm
by RahmatKhan
I think, you can use JOINKEYS for this. You will need to use the same input for both input datasets with SORTED. But if you post more details, it'll help.

Re: is it possible to read the next record for a condition

Posted: Sat Sep 19, 2015 10:06 pm
by zprogrammer
Rahmat

I appreciate your advice but we need to consider all conditions and suggest which would be better :) Good luck and Keep wandering here ..


Six digit,

Do we expect More deposits n reversal per account or is it Max 2 records per account?