Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum 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: 1330
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 Substring for 2 files in Sort JCL Shubhendu Chakraborty DFSORT/ICETOOL 1 Wed Nov 20, 2019 11:07 am
No new posts Substring for 2 files in Sort JCL Shubhendu Chakraborty SYNCSORT 5 Wed Nov 20, 2019 11:04 am
No new posts Sort to construct single record from ... Deepti_R SYNCSORT 3 Wed Nov 13, 2019 12:14 am
No new posts Capture DSN names through SORT / IDCAMS reach2abhinavtyagi DFSORT/ICETOOL 8 Tue Nov 05, 2019 7:33 pm
No new posts Convert mainframe data to .csv format... karan_reddy DFSORT/ICETOOL 10 Sat Nov 02, 2019 2:09 am

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