Join keys in SORT



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

Join keys in SORT

Postby justin_thilak » Tue Aug 24, 2010 3:44 pm

I have 2 input files F1, F2 and based on those 2 files by doing join keys operation I want to create 3 output files. Can we have 3 sortout files in a single step like this?
//STEP1         EXEC PGM=SORT
//SYSOUT      DD SYSOUT=*
//SORTJNF1   DD DSN=INFILE1,DISP=PASS
//SORTJNF2    DD DSN=INFILE2,DISP=PASS
//SORTOUT01  DD DSN=MATCHED,DISP=(NEW,CATLG,DELETE)
//SORTOUT02  DD DSN=UNPAIREDFRMF1,DISP=(NEW,CATLG,DELETE)
//SORTOUT03  DD DSN=UNPAIREDFRMF2,DISP=(NEW,CATLG,DELETE)
//SORT01CNTL  DD *
JOINKEYS FILE=F1,FIELDS=(1,4,CH,A)
JOINKEYS FILE=F2,FIELDS=(5,4,CH,A)
JOIN PAIRED,ONLY
/*
//SORT02CNTL  DD *
JOINKEYS FILE=F1,FIELDS=(1,4,CH,A)
JOINKEYS FILE=F2,FIELDS=(5,4,CH,A)
JOIN UNPAIRED,F1,ONLY
/*
//SORT03CNTL DD *
JOINKEYS FILE=F1,FIELDS=(1,4,CH,A)
JOINKEYS FILE=F2,FIELDS=(5,4,CH,A)
JOIN UNPAIRED,F2,ONLY
/*
//

I dont have mainframe access so can any one check it and correct me pls?
justin_thilak
 
Posts: 2
Joined: Tue Aug 24, 2010 3:35 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Join keys

Postby skolusu » Tue Aug 24, 2010 9:27 pm

Justin_thilak,

NO that syntax is not valid. Here is joinkeys job which will give you the desired results

//STEP0100 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//INA      DD *                                                   
AAAA - F1  MATCH                                                 
BBBB - F1  ONLYF1                                                 
CCCC - F1  ONLYF1                                                 
//INB      DD *                                                   
F2  AAAA  MATCH                                                   
F2  EEEE  ONLYF2                                                 
F2  FFFF  ONLYF2                                                 
//MATCH    DD SYSOUT=*                                           
//ONLYF1   DD SYSOUT=*                                           
//ONLYF2   DD SYSOUT=*                                           
//SYSIN    DD *                                                   
  OPTION COPY                                                     
  JOINKEYS F1=INA,FIELDS=(1,4,A)                                 
  JOINKEYS F2=INB,FIELDS=(5,4,A)                                 
  JOIN UNPAIRED                                                   
  REFORMAT FIELDS=(?,F1:1,80,F2:1,80)                             
  OUTFIL FNAMES=MATCH,INCLUDE=(1,1,CH,EQ,C'B'),BUILD=(2,160)     
  OUTFIL FNAMES=ONLYF1,INCLUDE=(1,1,CH,EQ,C'1'),BUILD=(2,80)     
  OUTFIL FNAMES=ONLYF2,INCLUDE=(1,1,CH,EQ,C'2'),BUILD=(82,80)     
//*


For complete details on JOINKEYS and the other new functions available with the Nov, 2009 DFSORT PTF, see:

http://www.ibm.com/support/docview.wss? ... g3T7000174
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Join keys

Postby justin_thilak » Wed Aug 25, 2010 6:15 pm

Hi
thank you very much for your reply. :lol:
justin_thilak
 
Posts: 2
Joined: Tue Aug 24, 2010 3:35 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post