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: 1226
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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts JCL sort Match and NoMatch rakeshsekar1987 SYNCSORT 2 Thu Feb 02, 2017 10:26 pm


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