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
 
Help with Sort - Remove duplicate record based on condition

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Vinutha Chandrakumar

New User


Joined: 11 Sep 2008
Posts: 1
Location: Bangalore

PostPosted: Fri Sep 19, 2008 7:21 pm    Post subject: Help with Sort - Remove duplicate record based on condition
Reply with quote

Hi,

Require help on Sort.

Input file has the below format:

123, aaa, 222, F, 2008-09-19
321, aaa, 222, F, 2008-09-19
123, aaa, 222, S, 2008-09-19

Output after sorting is:

123, aaa, 222, F, 2008-09-19
123, aaa, 222, S, 2008-09-19
321, aaa, 222, F, 2008-09-19

I want the duplicate to be removed only if the 4th column has S, which is in my above example the 2nd record should be removed.

So my ideal output is:

123, aaa, 222, F, 2008-09-19
321, aaa, 222, F, 2008-09-19

Please help me with the syntax for the above.

Regards,
Vinutha
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: Fri Sep 19, 2008 9:32 pm    Post subject:
Reply with quote

You need to explain your requirement in more detail. You need to give more input records with all of the variations, show the expected output records, and explain the "rules" better. Are you checking for duplicates on all of the fields except the 'S'/'F' field? Can that field have only 'F' or 'S' values? If not, what do you want to do for other values? What do you want to do if there are two duplicate 'F' records or two duplicate 'S' records or combinations of more than one 'F' and 'S' record?
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 SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm

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