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
 
How to delete second instance from Flat file in SORT/IceTool

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

New User


Joined: 13 Oct 2016
Posts: 16
Location: India

PostPosted: Tue Oct 18, 2016 11:42 pm    Post subject: How to delete second instance from Flat file in SORT/IceTool
Reply with quote

Hi Folks,

I've file like below :

Code:
SGCD   1.5  3.4  6.7
SGCD   2.5  3.6  6.7
F1CG    1.2  3.4  4.5
G1GH    1.5  2.5  6.7
F1CG     3.4  4.5  6.1


Here Key is First 4 letters/length: As per understanding when use SUM FIELDS=NONE it will delete second instance of duplicate record but its not true always ppl says since there few productions scenarios have been failed it seems.

hence i jsut wanted to know whats your view on this ? could you please help me to get better understanding.

Thanks
Gunapal
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10326
Location: italy

PostPosted: Wed Oct 19, 2016 12:27 am    Post subject: Reply to: How to delete second instance from Flat file in SORT/IceTool
Reply with quote

adding an OPTION EQUALS ???

to do the SUM sort needs to sort the input files
OPTION EQUALS will keep the equal keys in the sequence they were found in the input dataset
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2285
Location: @my desk

PostPosted: Wed Oct 19, 2016 1:35 am    Post subject:
Reply with quote

Quote:
there few productions scenarios have been failed it seems
Do you have an example of any such instance?
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1806
Location: NY,USA

PostPosted: Wed Oct 19, 2016 2:06 am    Post subject:
Reply with quote

Look here for more alternative along with whats being said plus you can add sequence number and restart for each unique combination and use include to get which of the duplicate you want in OUTFIL, SELECT operator
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Wed Oct 19, 2016 3:29 am    Post subject: Reply to: How to delete second instance from Flat file in SORT/IceTool
Reply with quote

If you are SORTing the data anyway (you need to with what you have shown) you can make the results consistent (a "stable sort" is the technical term for preserving the input order in the case of duplicate keys) by using OPTION EQUALS or specifying EQUAL on the SORT command, as enrico has indicated. No need to do anything else.

With SUM FIELDS=NONE the first record of which there are duplicate keys is retained. For a stable sort, that first record will always be the first record of that key from the input file.

If you specify EQUALS, there is some overhead, because a sequence number (a big one) is always made the most minor part of the sort key. So only use EQUALS when you need it.

"stable sort" doesn't imply anything "unstable", it just means the output is guaranteed reproducible. At a cost.

In a sort which is not stable, the most convenient record at the time will be the one which will be output in the case of duplicate keys.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1894
Location: UK

PostPosted: Wed Oct 19, 2016 3:52 am    Post subject:
Reply with quote

Not a JCL/VSAM query. In fact sort/Icetool was explicitly mentioned so how you managed to post in the wrong part of the forum is ...

Topic moved.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2285
Location: @my desk

PostPosted: Thu Oct 20, 2016 2:58 am    Post subject: Reply to: How to delete second instance from Flat file in SORT/IceTool
Reply with quote

I was assuming the "delete" in itself is not happening when the OP said it "failed" in production. Or is he just complaining about the second record not getting deleted always!
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 Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

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