is it possible to read the next record for a condition

SyncSort's Sort Product, SyncTool for z/OS, SYNCINIT and SYNCLIST.
Post Reply
six digit
New Member
Posts: 1
Joined: Tue Sep 01, 2015 8:33 pm

is it possible to read the next record for a condition

Post 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]
RahmatKhan
New Member
Posts: 5
Joined: Tue Mar 24, 2015 9:33 pm

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

Post by RahmatKhan »

Hi,

What is LRECL and RECFM of the input file? Can there be duplicates in the input?
RahmatKhan
New Member
Posts: 5
Joined: Tue Mar 24, 2015 9:33 pm

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

Post 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.
zprogrammer
Global Moderator
Global Moderator
Posts: 588
Joined: Wed Nov 20, 2013 11:53 am
Location: Mars

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

Post 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?
zprogrammer
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “SyncSort, SyncTool, SyncGener.”