Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Remove Duplicates after SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Remove Duplicates after SORT
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: 1187
Location: Bangalore,India

PostPosted: Mon Jan 29, 2007 10:37 am    Post subject:
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    Post subject: Re: Remove Duplicates after SORT
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 Moderator


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

PostPosted: Mon Jan 29, 2007 10:02 pm    Post subject:
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    Post subject: Re: Remove Duplicates after SORT
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    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 Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts JOINKEYS Paired and Unpaired Sort on ... MFwhiz DFSORT/ICETOOL 7 Tue Nov 07, 2017 2:46 am
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us