Merging data sets with ICETOOL without temporary DS



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Merging data sets with ICETOOL without temporary DS

Postby parthiban_82 » Mon Mar 19, 2018 2:21 pm

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
parthiban_82
 
Posts: 6
Joined: Thu Feb 22, 2018 2:12 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Merging data sets with ICETOOL without temporary DS

 

Re: Merging data sets with ICETOOL without temporary DS

Postby NicC » Mon Mar 19, 2018 6:48 pm

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,
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2748
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 110 times

Re: Merging data sets with ICETOOL without temporary DS

Postby enrico-sorichetti » Mon Mar 19, 2018 7:43 pm

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2701
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 139 times

Re: Merging data sets with ICETOOL without temporary DS

Postby parthiban_82 » Tue Mar 20, 2018 12:45 pm

Thanks Enrico. I meant the intermediate dataset T1. Thanks for your reply. I will use 2 steps.
parthiban_82
 
Posts: 6
Joined: Thu Feb 22, 2018 2:12 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post