Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Eliminating Dupicate records from dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Eliminating Dupicate records from dataset
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: 73
Location: Boston

PostPosted: Wed Feb 02, 2011 12:41 pm    Post subject:
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    Post subject:
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    Post subject:
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: 73
Location: Boston

PostPosted: Wed Feb 02, 2011 1:59 pm    Post subject:
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    Post subject:
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: 2285
Location: @my desk

PostPosted: Fri Feb 04, 2011 10:22 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us