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

Joined: 13 Aug 2009 Posts: 43 Location: chennai
|
|
|
|
Hi ,
How do we eliminate duplicates using easytreive sort . ie what is the equivalent to sort , sum fields = none that we use in sort.....?
I have a file with 100 records that has mutiple duplicate records. I want to to sort them and elminate teh duplucates.
I want this sorting and eliminating to be done in file not in report .
how can this be done in easytreive....? |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
If you are determined to eliminate duplicates "in the sort", suggest you use an external sort rather than Easytrieve.
If the process work better all within Easytrieve, compare the current record with the previous and skip the duplicates. . . |
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
Dick,
this is an Ezytrieve CLass homework assignment
or
there is some data manipulation that the TS did not feel necessary to divulge. |
|
| Back to top |
|
 |
PeterHolland
Global Moderator

Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Use this in your EZT job :
| Code: |
//$ORTPARM DD *
SUM FIELDS=NONE
|
|
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
| Quote: |
Use this in your EZT job :
| Code: |
//$ORTPARM DD *
SUM FIELDS=NONE |
|
Possibly - if the system uses Syncsort. . . |
|
| Back to top |
|
 |
PeterHolland
Global Moderator

Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
| Sure Dick, but which shop doesnt? |
|
| Back to top |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
| Ours doesn't use Syncsort -- just DFSORT. |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
| Quote: |
| but which shop doesnt? |
Many, many do not. . . |
|
| Back to top |
|
 |
PeterHolland
Global Moderator

Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
| For DFSORT the DFSPARM Data Set can be used. |
|
| Back to top |
|
 |
rkarthik22
New User
Joined: 18 Apr 2009 Posts: 47 Location: India
|
|
|
|
chockalingam_rsp
Easytrieve Plus provides a simple technique for identifying duplicate records in a file. The file should be sorted by the key field, then the Eastrieve keywords DUPLICATE, FIRST-DUP and LAST-DUP can be used to tell you not only if a record is a duplicate, but also if it is the first or last duplicate in a set of like keyed records.
| Code: |
//* JOBCARD HERE
//********************************************
//* DEMO USE OF "DUPLICATE", "FIRST-DUP" *
//* AND "LAST-DUP" KEYWORDS IN EASYTRIEVE *
//********************************************
//STEP010 EXEC PGM=EZTPA00
//MYDATA DD *
AAA 1 OF 1
BBB 1 OF 2
BBB 2 OF 2
CCC 1 OF 3
CCC 2 OF 3
CCC 3 OF 3
DDD 1 OF 2
DDD 2 OF 2
EEE 1 OF 1
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
FILE MYDATA
A-KEY 1 3 A
A-MSG 5 10 A
* WORKING-STORAGE
RECORDTYPE W 15 A
JOB INPUT (MYDATA KEY(A-KEY))
IF DUPLICATE MYDATA
RECORDTYPE = 'DUPLICATE'
PRINT MYREPORT
END-IF
* MUST USE "NOT DUPLICATE" INSTEAD OF "UNIQUE"
IF NOT DUPLICATE MYDATA
RECORDTYPE = 'NOT DUPLICATE'
PRINT MYREPORT
END-IF
IF FIRST-DUP MYDATA
RECORDTYPE = 'FIRST-DUP'
PRINT MYREPORT
END-IF
IF LAST-DUP MYDATA
RECORDTYPE = 'LAST-DUP'
PRINT MYREPORT
END-IF
REPORT MYREPORT LINESIZE 80
LINE A-KEY A-MSG RECORDTYPE
|
This is a sample code i got from
www.caliberdt.com/tips/Nov2005.htm |
|
| Back to top |
|
 |
|
|