Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts JCL sort Match and NoMatch rakeshsekar1987 SYNCSORT 2 Thu Feb 02, 2017 10:26 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us