Page 1 of 1

Merging data sets with ICETOOL without temporary DS

PostPosted: Mon Mar 19, 2018 2:21 pm
by parthiban_82
Hi,

I have 2 files to which I append XA to 1st file and XB to 2nd file. Then I concatenate both files and sort them based in key fields (7,8) and the appended field so that I always get the XA record first in case of duplicates. I am using a temporary file to concatenate the records and got the desired output. But in my company they don't allow us to use Temporary file with MOD as disposition parameter. Is there a way to achieve this without temporary file. Below in the JCL used.

//DATA1 DD DISP=SHR,DSN=TEST.TRIN.PMR756XA.MCPIPEFL(+0)        
//DATA2 DD DISP=SHR,DSN=TEST.UPLD.PMR756XB.UNCVPCFL(+0)        
//*                                                            
//T1       DD DISP=(MOD,CATLG,DELETE),                        
//            UNIT=SYSDA,                                      
//            DCB=(RECFM=VB,LRECL=1366,BLKSIZE=0),            
//            SPACE=(TRK,(15,500)),                            
//            DSN=TEST.SPLIC49.ACCOUNTS.BOTH                  
//OUTDD    DD DISP=(NEW,CATLG,DELETE),                        
//            UNIT=SYSDA,                                      
//            DCB=(RECFM=VB,LRECL=1364,BLKSIZE=0),            
//            SPACE=(TRK,(15,500)),                            
//            DSN=TEST.SPLIC69.ACCOUNTS.BOTH                  
//CTL1CNTL DD *                                                
  OMIT COND=(5,4,CH,EQ,C'UTRL')                                
  OUTREC BUILD=(1,4,C'XA',7:5)                                
/*                                                            
//*                                                            
//CTL2CNTL DD *                                                
  OMIT COND=((5,4,CH,EQ,C'UHDR',AND,1,2,BI,LT,18),OR,          
             (5,4,CH,EQ,C'UTRL'))                              
  OUTREC BUILD=(1,4,C'XB',7:5)                                
/*                                                            
//*                                                            
//CTL3CNTL DD *                                                
  SORT FIELDS=(7,8,CH,A,5,2,CH,A)                              
  OUTREC BUILD=(1,4,5:7)                                      
/*                                                            
//*                                                            
//*                                                            
//TOOLIN   DD *                                                
  COPY FROM(DATA1) TO(T1)    USING(CTL1)                      
  COPY FROM(DATA2) TO(T1)    USING(CTL2)                      
  COPY FROM(T1)    TO(OUTDD) USING(CTL3)                      
/*                                                            
//*


CODE' d

Re: Merging data sets with ICETOOL without temporary DS

PostPosted: Mon Mar 19, 2018 6:48 pm
by NicC
1 - Are you sure that you are using the DFSort product? Your previous posts have been under the SYNCSORT/SYNCTOOL title.
2 - What is it about the MERGE function that does not satisy your requirement?
3 - You have previously been told that "files" is incorrect terminology. Please correct you usage,

Re: Merging data sets with ICETOOL without temporary DS

PostPosted: Mon Mar 19, 2018 7:43 pm
by enrico-sorichetti
review Your way of thinking 8-)
You did not use any temporary dataset here ...

//T1       DD DISP=(MOD,CATLG,DELETE),                        
//            UNIT=SYSDA,                                      
//            DCB=(RECFM=VB,LRECL=1366,BLKSIZE=0),            
//            SPACE=(TRK,(15,500)),                            
//            DSN=TEST.SPLIC49.ACCOUNTS.BOTH          


the point is that You are using different OMIT conditions on the two datasets

the simple solution is to use TWO steps to create the intermediate datasets
the first one an ICETOOL to do the OMIT plaing the output on ( random names T1/T2 )
the second one to do the sort on the concatenation of the two.

probably the elapsed/cpu times will be almost the same

Re: Merging data sets with ICETOOL without temporary DS

PostPosted: Tue Mar 20, 2018 12:45 pm
by parthiban_82
Thanks Enrico. I meant the intermediate dataset T1. Thanks for your reply. I will use 2 steps.