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

Eliminate dupliates in easytreive sort


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chockalingam_rsp

New User


Joined: 13 Aug 2009
Posts: 43
Location: chennai

PostPosted: Mon Dec 07, 2009 6:57 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Dec 07, 2009 9:21 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Dec 07, 2009 10:11 pm
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Dec 08, 2009 12:05 am
Reply with quote

Use this in your EZT job :

Code:

//$ORTPARM DD  * 
 SUM FIELDS=NONE
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Dec 08, 2009 12:12 am
Reply with quote

Hello,

Quote:
Use this in your EZT job :

Code:
//$ORTPARM DD  * 
 SUM FIELDS=NONE

Possibly - if the system uses Syncsort. . .
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Dec 08, 2009 12:29 am
Reply with quote

Sure Dick, but which shop doesnt?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Dec 08, 2009 12:36 am
Reply with quote

Ours doesn't use Syncsort -- just DFSORT.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Dec 08, 2009 12:36 am
Reply with quote

Hello,

Quote:
but which shop doesnt?
Many, many do not. . .
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Dec 08, 2009 2:14 pm
Reply with quote

For DFSORT the DFSPARM Data Set can be used.
Back to top
View user's profile Send private message
rkarthik22

New User


Joined: 18 Apr 2009
Posts: 47
Location: India

PostPosted: Thu Dec 10, 2009 10:11 am
Reply with quote

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
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 -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top