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
 
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: 1243
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 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
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am

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