IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Sort and remove dups


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 1353
Location: Israel

PostPosted: Sun Jan 04, 2015 6:38 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top