|
View previous topic :: View next topic
|
| Author |
Message |
jaffarhussain
New User

Joined: 26 Nov 2010 Posts: 30 Location: Hyderabad
|
|
|
|
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 |
|
 |
hailashwin
New User

Joined: 16 Oct 2008 Posts: 74 Location: Boston
|
|
|
|
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 |
|
 |
jaffarhussain
New User

Joined: 26 Nov 2010 Posts: 30 Location: Hyderabad
|
|
|
|
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 |
|
 |
ssmukul
New User
Joined: 22 Jan 2008 Posts: 19 Location: India
|
|
|
|
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 |
|
 |
hailashwin
New User

Joined: 16 Oct 2008 Posts: 74 Location: Boston
|
|
|
|
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 |
|
 |
jaffarhussain
New User

Joined: 26 Nov 2010 Posts: 30 Location: Hyderabad
|
|
|
|
| Thank you it worked |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
| 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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|