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
 

 

Sort and remove dups

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

New User


Joined: 11 Nov 2008
Posts: 27
Location: Canada

PostPosted: Sun Jan 04, 2015 10:53 am    Post subject: Sort and remove dups
Reply with quote

I have below case where I want to remove dups.

I have values in column 1 and column 2.
Well the same row can exist in the file with column values exchanged. But I would like to remove the second such row(which is kind of duplicate according to above rule)

For ex: (INPUT) (my file has exactly same format and is 80 char in length)
AAA BBB
CCC DDD
BBB AAA
DDD CCC
XXX YYY

The output should contain only unique records.
AAA BBB
CCC DDD
XXX YYY

the other two are removed because they were already there with columns exchanged.

Any idea if I can do it through SORT/DFSORT/ICETOOL instead of cobol?
Back to top
View user's profile Send private message

Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1228
Location: Israel

PostPosted: Sun Jan 04, 2015 6:38 pm    Post subject:
Reply with quote

That is quite easy.
This works with the other sort product, it should work with DFSORT as well:
Code:
   INREC  IFTHEN=(WHEN=(1,3,CH,LT,5,3,CH),
                 BUILD=(1:1,80,1,3,5,3)),
          IFTHEN=(WHEN=NONE,             
                 BUILD=(1:1,80,5,3,1,3))
   SORT   FIELDS=(81,6,A),FORMAT=CH,EQUALS
   OUTREC BUILD=(1:1,80)                 
   SUM    FIELDS=NONE                       
Back to top
View user's profile Send private message
skgupta81

New User


Joined: 11 Nov 2008
Posts: 27
Location: Canada

PostPosted: Sat Jan 24, 2015 12:44 am    Post subject:
Reply with quote

Thanks for your help.
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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
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. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm


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