Page 1 of 1

ICETOOL-SPLICE 3 Files in, 1 out

PostPosted: Thu Mar 19, 2009 9:58 pm
by smfden
Hello, I have 3 input files, with the first being the base and the 2 others potentially having additional data for each base record.
I would like to splice them into 1 output file. There are no dupes, and there is a key in all 3 files. I would like to keep all records in the base file.

//IN1 DD * 
2432     REE
2433     REE
2434     REF
2436     REJ
2437     RRE
2477     RER
//IN2 DD * 
2432      MG
2437      MG
//IN3 DD * 
2437      CD
2477      CD


I would like to get results like this:
2432     REE     MG
2433     REE           
2434     REF           
2436     REJ           
2437     RRE     MG    CD
2477     RER           CD



I can get close with following:
  COPY FROM(IN1) TO(TEMP1) USING(CTL1)           
  COPY FROM(IN2) TO(TEMP1) USING(CTL2)           
  COPY FROM(IN3) TO(TEMP1) USING(CTL3)           
  SPLICE FROM(TEMP1) TO(OUTFILE) -               
     ON(1,4,CH) WITHEACH KEEPNODUPS WITH(18,2) -
                       WITH(24,2) USING(CTL4)   
 //CTL1CNTL DD *                                 
    OUTREC FIELDS=(1,12,25:X)                   
 //CTL2CNTL DD *                     
    OUTREC FIELDS=(1,4,18:11,2,25:X)
 //CTL3CNTL DD *                     
    OUTREC FIELDS=(1,4,24:11,2)     


However, it drops the value CD from IN3 for the 2477 record. giving me:
2432     REE     MG     
2433     REE               
2434     REF               
2436     REJ               
2437     RRE     MG    CD
2477     RER   


Hope that makes sense...any help would be appreciated. Thanks!

Re: ICETOOL-SPLICE 3 Files in, 1 out

PostPosted: Thu Mar 19, 2009 11:25 pm
by Frank Yaeger
Use WITHANY instead of WITHEACH.

WITHANY is available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008). If you don't have that PTF installed, ask your System Programmer to install it (it's free). For complete details on the new WITHANY function and the other new functions available with PTF UK90013, see:

http://www.ibm.com/systems/support/stor ... /mvs/ugpf/

Re: ICETOOL-SPLICE 3 Files in, 1 out

PostPosted: Fri Mar 20, 2009 1:31 am
by smfden
hmm. I get an empty dataset using WITHANY...so, it must not be installed yet.
I will request our admin to install that PTF...hopefully he can get to it quickly. I will definitely use that function a lot.

Thanks for your fast reply!

Re: ICETOOL-SPLICE 3 Files in, 1 out

PostPosted: Fri Mar 20, 2009 2:02 am
by Frank Yaeger
If you didn't have the PTF, you would get an error message for WITHANY in TOOLMSG.
Perhaps you missed it.

            SPLICE FROM(TEMP1) TO(OUTFILE) -               
               ON(1,4,CH) WITHANY KEEPNODUPS WITH(18,2) -   
                              $                             
ICE604A 0 ERROR IN KEYWORD, PARAMETER, OR DELIMITER