Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Mon Jul 21, 2008 11:20 am Post subject:
We are multiplying the first count (count1) by -1, adding it to the second count (count2), writing a record to OUT1 if the result is 0, and setting the return code based on whether the record was included or not.
The WHEN=INIT puts a sequence number in position 12. So the first record will have seqnum 1 and the second record will have seqnum 2. The WHEN=(12,1,ZD,EQ,1) finds the first record by its seqnum of 1 and multiplies count1 by -1. So now the first record has -count1 and the second record has +count2. SUM gets one record with count = -count1 + count2. If count1 and count2 are equal, the result is 0. If count1 and count2 are not equal, the result is not zero. The OUTFIL INCLUDE includes the record if count is 0 or omits the record is count is not 0. NULLOFL=RC16 sets RC=16 if no records are included (count is not 0).
Does that help? _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
All times are GMT - 5 Hours Goto page Previous1, 2, 3
Page 3 of 3
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum