Monday, September 26, 2011

SORT - Writing Duplicate records into a file

Do you know how to write the duplicate records into a separate file while eliminating the duplicate records in SORT?

Here is the way to do that..

Special DD name SORTXSUM is available in SYNCSORT.

In this you need to specify the file name in which you need the duplicates to be get stored.

Then in the sysin card you need to specify as below mentioned,

SUM FIELDS=NONE,XSUM


 To achieve the same in DFSORT, you need to use ICETOOL:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//OUT1 DD DSN=...  output file 1
//OUT2 DD DSN=...  output file 2
//TOOLIN DD *
 SELECT FROM(IN) TO(OUT1) DISCARD(OUT2) ON(1,4,CH) FIRST
/*

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.