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
 

 

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
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm


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