Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
Deepa.m
Warnings : 1

New User

Joined: 28 Apr 2005
Posts: 99

 Posted: Mon Jun 06, 2005 11:57 am    Post subject: How Sum FIELDS=NONE remove duplicates Can someone explain the logic how this statement removes duplicates form the file. SUM FILEDS=NONE.

shannu

New User

Joined: 01 Jun 2005
Posts: 17
Location: bangalore

 Posted: Mon Jun 06, 2005 12:43 pm    Post subject: 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.
Warnings : 1

New User

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

 Posted: Mon Jun 06, 2005 1:39 pm    Post subject: Re: how do sum fields=none remove duplicates. 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.
Deepa.m
Warnings : 1

New User

Joined: 28 Apr 2005
Posts: 99

 Posted: Mon Jun 06, 2005 4:44 pm    Post subject: Thank you.. :-)

New User

Joined: 05 Sep 2004
Posts: 21

 Posted: Mon Jun 06, 2005 7:58 pm    Post subject: Hi, I do appriciate Aditya. thanks for nice concepts. do the same. bye

New User

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

 Posted: Wed Apr 11, 2007 2:09 pm    Post subject: Re: how do sum fields=none remove duplicates. HI, In case we have RAJAN after RAJAN in a row (6 to 10)would it help?
guptae

Moderator

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

Posted: Wed Apr 11, 2007 2:28 pm    Post subject:

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?
Frank Yaeger

DFSORT Moderator

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

Posted: Wed Apr 11, 2007 8:59 pm    Post subject:

 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

New User

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

 Posted: Thu Apr 12, 2007 10:45 am    Post subject: 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
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Sort numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 13 Fri Mar 23, 2018 10:54 am Sum the fields in particular format f... sharana64 DFSORT/ICETOOL 9 Fri Jan 05, 2018 1:11 am SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us