IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Eliminating Dupicate records from dataset


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jaffarhussain

New User


Joined: 26 Nov 2010
Posts: 30
Location: Hyderabad

PostPosted: Wed Feb 02, 2011 12:27 pm
Reply with quote

I am trying to eliminate duplicate records from the data set but getting some error.

//DELETE EXEC PGM=IEFBR14
//DD1 DD DSN=ABC.DUPREC,DISP=(MOD,DELETE)
//DUPREC EXEC PGM=SORT
//SORTIN DD DSN=ABC.EMPDATA1,DISP=SHR
//SORTXSUM DD DSN=ABC.DUPREC,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(CYL,(1,4),RLSE),
// DCB=(RECFM=FBM,LRECL=80,BLKSIZE=800)
//SYSIN DD *
SORT FIELDS=(1,7,CH,A)
SUMFIELDS=NONE,XSUM
/*
//SYSOUT DD SYSOUT=*
//

Error I am getting is this:

SYSIN :
SORT FIELDS=(1,7,CH,A)
SUMFIELDS=NONE,XSUM
*
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE

Why is this occuring.
Back to top
View user's profile Send private message
hailashwin

New User


Joined: 16 Oct 2008
Posts: 74
Location: Boston

PostPosted: Wed Feb 02, 2011 12:41 pm
Reply with quote

Hi,
Two things you would need to correct.
1. Add a SORTOUT dataset
2. Syntax is 'SUM FIELDS' -> Notice the space between SUM and FIELDS.

Thanks,
Ashwin
Back to top
View user's profile Send private message
jaffarhussain

New User


Joined: 26 Nov 2010
Posts: 30
Location: Hyderabad

PostPosted: Wed Feb 02, 2011 1:02 pm
Reply with quote

Thank you .
It has worked but the out put is copying Duplicate records into the file instead od removing duplicate records an copying all records .
Why is this happening ?
Back to top
View user's profile Send private message
ssmukul

New User


Joined: 22 Jan 2008
Posts: 19
Location: India

PostPosted: Wed Feb 02, 2011 1:41 pm
Reply with quote

Hi Jaffar,

First of all, you have SYNCSORT not DFSORT. You have posted in the wrong forum.

Now, in the above sort step unique records will be written to SORTOUT dataset while the duplicates will be written to SORTXSUM dataset.

Thanks,
Back to top
View user's profile Send private message
hailashwin

New User


Joined: 16 Oct 2008
Posts: 74
Location: Boston

PostPosted: Wed Feb 02, 2011 1:59 pm
Reply with quote

Hi,
I guess you have replaced SORTXSUM with SORTOUT. Declare SORTXSUM as well as a SORTOUT dataset. SORTOUT will have duplicates and your SORTXSUM will have unique data. It is mandatory that you have a sortout when you use SORTXSUM.
Code:

//SORTOUT  DD DSN=dd1, --->> Dataset1     
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(CYL,(1,4),RLSE),             
// DCB=(RECFM=FBM,LRECL=80,BLKSIZE=800)
//SORTXSUM DD DSN=dd2, --->> Dataset2         
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(CYL,(1,4),RLSE),             
// DCB=(RECFM=FBM,LRECL=80,BLKSIZE=800)
//SYSIN DD *                           
  SORT FIELDS=(1,7,CH,A)               
  SUM FIELDS=NONE,XSUM                 
/*                                     
//SYSOUT DD SYSOUT=*     
             


Thanks,
Ashwin.
Back to top
View user's profile Send private message
jaffarhussain

New User


Joined: 26 Nov 2010
Posts: 30
Location: Hyderabad

PostPosted: Wed Feb 02, 2011 2:38 pm
Reply with quote

Thank you it worked
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Feb 04, 2011 10:22 am
Reply with quote

Quote:
SORTOUT will have duplicates and your SORTXSUM will have unique data
hailashwin,

Are you sure about this? AFAIK it is not true.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
Search our Forums:

Back to Top