Posted: Tue Oct 19, 2004 2:12 pm Post subject: DFSort: splice problem
I'm attempting to splice two datasets (both LRECL=110, RECFM=FB) on a common key and the results I'm getting seem to contradict what I thought I knew about how splice works.
My goal is to keep only the records in WAPTEMP1 that do not match any record in STVNDTMP on the key in columns 91-96. There are duplicate keys in WAPTEMP1, but not in STVNDTMP.
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
My reasoning is that any record from WAPTEMP1 that doesn't match a record on STVNDTMP will still have the value '22' starting at column 109 after the splice, since there will be no overlay value from the other dataset.
Actual Results:
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
0515 2 0543
0515 3 0543
0515 4 0543
0515 5 0543
0515 2 0543
The records with the '264622' key are being removed correctly, but it appears that the first record in each group of duplicate keys on records that don't match is dropping out. What have I done wrong or misunderstood here?
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Tue Oct 19, 2004 2:51 pm Post subject:
Sterling price,
The reason that you're losing one of the non-matched dups is that SPLICE doesn't know it's from WAPTEMP1, so it splices the two dups together to get one record. To keep the non-matched dups in WAPTEMP1, you have to protect them by inserting an extra base record for each non-matched dup.
Check the last posts in this topic which helps in understanding the workings of SPLICE
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