Syncsort Join



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Syncsort Join

Postby Eagle » Thu Nov 04, 2010 8:40 pm

I have two input files, "File 1" and "File 2" that have the same record length and format. I want to use Syncsort to to remove the records that exist on File 1 from File 2 and write all records from File 1 and only the unmatched records from File 2 in one output file. The matched records from File 2 can be discarded.

Questions:
What tool should I use?
Can this be done in one sort step?
If so, can you provide a generic example?
If not, I can easily accomplish this with two steps.

The key is the first 33 bytes of the 500-byte LRECL. Sample data:
IN   00101ABC00000000000123456789
IN   00101DEF00000000000234567890
- Eagle -
User avatar
Eagle
 
Posts: 8
Joined: Thu Nov 04, 2010 8:11 pm
Has thanked: 5 times
Been thanked: 0 time

Re: Syncsort Join

 

Re: Syncsort Join

Postby Eagle » Thu Nov 04, 2010 10:45 pm

One additional note: Duplicates should not be removed.
- Eagle -
User avatar
Eagle
 
Posts: 8
Joined: Thu Nov 04, 2010 8:11 pm
Has thanked: 5 times
Been thanked: 0 time

Re: Syncsort Join

Postby Alissa Margulies » Thu Nov 04, 2010 11:47 pm

Here is a sample job that may help you:
//STEP1  EXEC PGM=SORT                                 
//SORTJNF1 DD DSN=FILE1       
//SORTJNF2 DD DSN=FILE2
//SORTOUT  DD SYSOUT=*                                 
//SYSOUT   DD SYSOUT=*                                 
//SYSIN    DD *                                         
  JOINKEYS FILES=F1,FIELDS=(1,33,A)                   
  JOINKEYS FILES=F2,FIELDS=(1,33,A)                   
  JOIN UNPAIRED                                       
  REFORMAT FIELDS=(F1:1,500,F2:1,500)                   
  SORT FIELDS=COPY                                   
  OUTREC IFTHEN=(WHEN=(1,1,CH,EQ,C' '),BUILD=(501,500)),
         IFTHEN=(WHEN=NONE,BUILD=(1,500))           
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time

Re: Syncsort Join

Postby Eagle » Fri Nov 05, 2010 12:08 am

Thank you, Alissa!
- Eagle -
User avatar
Eagle
 
Posts: 8
Joined: Thu Nov 04, 2010 8:11 pm
Has thanked: 5 times
Been thanked: 0 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post