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
 

 

How Sum FIELDS=NONE remove duplicates

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Deepa.m
Warnings : 1

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Mon Jun 06, 2005 11:57 am    Post subject: How Sum FIELDS=NONE remove duplicates
Reply with quote

Can someone explain the logic how this statement removes duplicates form the file.

SUM FILEDS=NONE.
Back to top
View user's profile Send private message

shannu

New User


Joined: 01 Jun 2005
Posts: 17
Location: bangalore

PostPosted: Mon Jun 06, 2005 12:43 pm    Post subject:
Reply with quote

Deepu,

Sum fields allows to sumup value(if it's numeric) along with eliminating the duplicates.
If u specify sum fields=none.
You are stating that just eliminate the duplicates with no summation or when u have only character fields.

It's internal logic?

Regads,
shannu.
Back to top
View user's profile Send private message
Aditya Bhardwaj
Warnings : 1

New User


Joined: 02 Nov 2004
Posts: 18
Location: Noida, India

PostPosted: Mon Jun 06, 2005 1:39 pm    Post subject: Re: how do sum fields=none remove duplicates.
Reply with quote

Hi Deepu,

I'll expain U regarding SUM FIELDS with this example :

Suppose, this is the SYSIN of a SORT card :

//SYSIN DD *
SORT FIELDS = (1,5,CH,A)
SUM FIELDS = (6,5,PD)
/*

Now suppose the input file is having "RAJAN" in filelds 1 -5 and then in 6- 10 fileds, it is having some numeric data say marks.

Now when the above SORT is executed, it will find out all the RAJAN from the input file and SUM all the marks (fileds 6-10) in the input data correpsonding to all RAJAN. The output will therefore have only one record with "RAJAN" and along with it the sum of all the marks that were present for RAJAN.

Now, when we give, SUM FIELDS = NONE, then the SORT tries to find out all RAJAN and in the output, give only one entry for RAJAN , but since SUM FILEDS=NONE is given, so it does not add the corresponding fields (6-10) along with RAJAN.

So, that way all the duplicate entries having RAJAN are removed and only one entry is left.

So, the output will have entry of the very first record having RAJAN in it.

I hope I'm able 2 convey 2 U wat I intend, if U r not clear, then plz let me know, I'll try 2 explain it little more comprehensively.
Back to top
View user's profile Send private message
Deepa.m
Warnings : 1

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Mon Jun 06, 2005 4:44 pm    Post subject:
Reply with quote

Thank you.. :-)
Back to top
View user's profile Send private message
badal

New User


Joined: 05 Sep 2004
Posts: 21

PostPosted: Mon Jun 06, 2005 7:58 pm    Post subject:
Reply with quote

Hi,
I do appriciate Aditya.
thanks for nice concepts.
do the same.
bye
Back to top
View user's profile Send private message
dilipbiradar

New User


Joined: 12 Jan 2007
Posts: 19
Location: Pune (India)

PostPosted: Wed Apr 11, 2007 2:09 pm    Post subject: Re: how do sum fields=none remove duplicates.
Reply with quote

HI,
In case we have RAJAN after RAJAN in a row (6 to 10)would it help?
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Wed Apr 11, 2007 2:28 pm    Post subject:
Reply with quote

Hi Dilip,

What do u mean by that?

Quote:
In case we have RAJAN after RAJAN in a row (6 to 10)would it help?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Apr 11, 2007 8:59 pm    Post subject:
Reply with quote

Quote:
So, the output will have entry of the very first record having RAJAN in it.


Note that this is only guaranteed to be true if EQUALS is in effect, e.g.

Code:

   OPTION EQUALS


For complete details on DFSORT's SUM statement, see:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/3.17?DT=20060615185603
Back to top
View user's profile Send private message
dilipbiradar

New User


Joined: 12 Jan 2007
Posts: 19
Location: Pune (India)

PostPosted: Thu Apr 12, 2007 10:45 am    Post subject:
Reply with quote

Hi Ekta,
It was refering to the example provided by Aditya. I wrote corresponding question for the same.

Thank You for your concern !
Dilip Biradar
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 SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 5 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Updating the counters after eliminati... PANDU1 DFSORT/ICETOOL 12 Mon Nov 21, 2016 9:47 am
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am


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