MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DFSort: splice problem

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Sterling Price
Beginner


Joined: 30 Aug 2004
Posts: 19
Topics: 8

PostPosted: Tue Oct 19, 2004 2:12 pm    Post subject: DFSort: splice problem Reply with quote

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.

Here are the JCL and control statements:

Code:

//STEP01   EXEC PGM=ICETOOL                                     
//TOOLMSG  DD  SYSOUT=*                                         
//DFSMSG   DD  SYSOUT=*                                         
//STVNDTMP DD DSN=T01.US.FIN.FI0212M.STATE.VENDORS,DISP=SHR     
//WAPTEMP1 DD DSN=T01.US.FIN.FI0212M.WAPMSTR.TEMP1,DISP=SHR     
//VNDWAP   DD DSN=*.STVNDTMP,VOL=REF=*.STVNDTMP,DISP=(OLD,PASS)
//         DD DSN=*.WAPTEMP1,VOL=REF=*.WAPTEMP1,DISP=(OLD,PASS)
//WAPTEMP2 DD DSN=T01.US.FIN.FI0212M.WAPMSTR.TEMP2,             
//            DISP=(NEW,CATLG,DELETE),LRECL=110,               
//            SPACE=(TRK,(1,1),RLSE),RECFM=FB                 
//TOOLIN   DD *                                                 
                                                               
  SPLICE FROM(VNDWAP) TO(WAPTEMP2) ON(91,6,CH) WITH(1,27) -     
    WITH(109,1) USING(CT01) WITHALL KEEPNODUPS                 

//CT01CNTL DD *                                                     
                                                                     
  OUTFILE FNAMES=WAPTEMP2,OMIT=(109,2,CH,NE,C'22')                   



STVNDTEMP layout:

Code:


----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
                                                                               
                                                                               
                                                                               
                                                                               

(continued)

----+----9----+----0----+----1
******************************
          021295            11
          045873            11
          200732            11
          241702            11
          264622            11




WAPTEMP1 layout

Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
  0515           1 0543                                                         
  0515           2 0543                                                         
  0515           3 0543                                                         
  0515           4 0543                                                         
  0515           5 0543                                                         
  0515           1 0543                                                         
  0515           2 0543                                                         
  0515           1 0543                                                         
  0515           2 0543     

(continued)                                                   

----+----9----+----0----+----1
******************************
          049700            22
          049700            22
          049700            22
          049700            22
          049700            22
          242021            22
          242021            22
          264622            22
          264622            22



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                                                         

----+----9----+----0----+----1
******************************
          049700            22
          049700            22
          049700            22
          049700            22
          242021            22



Expected Results:
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
  0515           1 0543   
  0515           2 0543                                                         
  0515           3 0543                                                         
  0515           4 0543                                                         
  0515           5 0543                                                         
  0515           1 0543   
  0515           2 0543                                                         

----+----9----+----0----+----1
******************************
          049700            22
          049700            22
          049700            22
          049700            22
          049700            22
          242021            22
          242021            22         



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?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Oct 19, 2004 2:51 pm    Post subject: Reply with quote

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

http://www.mvsforums.com/helpboards/viewtopic.php?t=2951&highlight=splice

Hope this helps...

Cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Sterling Price
Beginner


Joined: 30 Aug 2004
Posts: 19
Topics: 8

PostPosted: Tue Oct 19, 2004 3:46 pm    Post subject: Reply with quote

Now I see...thank you Kolusu, it helped indeed.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group