Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 2180
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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Updating the counters after eliminati... PANDU1 DFSORT/ICETOOL 12 Mon Nov 21, 2016 9:47 am
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us