Page 1 of 1

Merge and eliminate duplicates using SORT

PostPosted: Thu Mar 14, 2013 11:28 pm
by gauravuppal11
I have two variable record size files FILEA and FILEB with key from position 15 to position 113.
Both the files can contain duplicates on the key.

I want to merge these two files ( write all records of both file) into one file but if there are duplicates present on the key, i want to write the records ONLY from filea.

How can i do this using sort / icetool.

Re: merge and eliminate duplicates

PostPosted: Fri Mar 15, 2013 3:20 am
by skolusu
1. What is the LRECL and RECFM of the input file1?
2.What is the LRECL and RECFM of the input file2?
3. Please run the following job and show us the complete sysout which helps us determine the level of DFSORT you have.
//STEP0100 EXEC PGM=SORT   
//SYSOUT   DD SYSOUT=*     
//SORTIN   DD *             
//SORTOUT  DD SYSOUT=*     
//SYSIN    DD *             
  OPTION COPY               
//*

Re: merge and eliminate duplicates

PostPosted: Fri Mar 15, 2013 8:25 am
by gauravuppal11
LRECL = 728 RECFM = VB for both the files
Here is the sysout you have requested for -
********************************* TOP OF DATA *************************************************************************************
SYNCSORT FOR Z/OS 1.3.2.2N U.S. PATENTS: 4210961, 5117495 (C) 2007 SYNCSORT INC. DATE=2013/073 TIME=21.54.00
z/OS 1.13.0
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 1BDBD, MODEL 2097 408 LICENSE/PRODUCT EXPIRATION DATE: 02 MAY 2014
SYSIN :
OPTION COPY
WER108I SORTIN : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER110I SORTOUT : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER054I RCD IN 0, OUT 0
WER169I RELEASE 1.3 BATCH 0513 TPF LEVEL 2.2
WER052I END SYNCSORT - ,SORT,,DIAG=8600,4044,AA8A,00E6,CE66,68EB,AE88,A666
******************************** BOTTOM OF DATA ***********************************************************************************

Re: merge and eliminate duplicates

PostPosted: Fri Mar 15, 2013 1:09 pm
by NicC
I suggest you actually read your sysout especially line 1 and then you will know why the topic has been moved.

Re: merge and eliminate duplicates

PostPosted: Fri Mar 15, 2013 9:44 pm
by gauravuppal11
Ok i am sorry if i posted in the wrong heading. I will wait for someone to reply then.

Re: merge and eliminate duplicates

PostPosted: Sat Mar 16, 2013 5:20 pm
by BillyBoyo
Simplest would be to "de-duplicate" your file 2 in a separate step (as, with SyncSort 1.3.2 I don't think you can use the JNFnCNTL files for JOINKEYS) and then it is a simple JOINKEYS operation.

If your file 2 is enormous, let us know and there might be something using fewer resources, but with more code.

Re: merge and eliminate duplicates

PostPosted: Mon Mar 18, 2013 9:44 pm
by gauravuppal11
Thanks for the reply, yes my File 2 is humongous.