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

Remove Duplicates after SORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
richie

New User


Joined: 11 Jun 2005
Posts: 24

PostPosted: Mon Jan 29, 2007 8:42 am
Reply with quote

Hi,

I have two files of LRECL 350
I would like to sort these files on (1,9,CH,A,85,8,CH,D,251,1,CH,D).

1:9 - client-no 85:8 product-date 251:1 priroity

After Sorting , i want to retain the first record and eliminate duplicates only on first key 1:9 i.e client-no

SUM FIELDS= NONE checks on the complete sort-key i.e client-no , exam-date and priority to remove duplicates.

rather i would like to remove all records having duplicate client-no here.

Any advise please.Thanks a lot.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Mon Jan 29, 2007 10:37 am
Reply with quote

Hi Richi,

You can add one more step in ur job to again sort on Client number & use OPTION EQUALS to retain the first record

Code:
OPTION EQUALS
SORT FIELDS=(1,9,CH,A)
SUM FIELDS=NONE   
Back to top
View user's profile Send private message
richie

New User


Joined: 11 Jun 2005
Posts: 24

PostPosted: Mon Jan 29, 2007 10:53 am
Reply with quote

Hi Ekta,

Thanks for your reply.

I know i can do it in two steps. Was wondering if this can be done in a single step.

Any advise to do this in single step.

Thanks!
Richie!
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Jan 29, 2007 10:02 pm
Reply with quote

Richie,

Here's a DFSORT/ICETOOL job that will do what you want in one pass:

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//OUT DD DSN=...  output file
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,9,CH) FIRST USING(CTL1)
/*
//CTL1CNTL DD *
  SORT FIELDS=(1,9,CH,A,85,8,CH,D,251,1,CH,D)
/*
Back to top
View user's profile Send private message
richie

New User


Joined: 11 Jun 2005
Posts: 24

PostPosted: Tue Jan 30, 2007 7:26 am
Reply with quote

Thanks Frank.

I will check if it works.
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 -> DFSORT/ICETOOL

 


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 Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
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
Search our Forums:

Back to Top