View previous topic :: View next topic
|
Author |
Message |
Deepa.m
New User
Joined: 28 Apr 2005 Posts: 99
|
|
|
|
Can someone explain the logic how SUM FIELDS=NONE statement removes duplicates form the JCL file.
SUM FILEDS=NONE. |
|
Back to top |
|
|
shannu
New User
Joined: 01 Jun 2005 Posts: 17 Location: bangalore
|
|
|
|
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 |
|
|
Aditya Bhardwaj Warnings : 1 New User
Joined: 02 Nov 2004 Posts: 18 Location: Noida, India
|
|
|
|
Hi Deepu,
I'll expain U regarding SUM FIELDS with this example :
Suppose, this is the SYSIN of a SORT card :
Code: |
//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 |
|
|
Deepa.m
New User
Joined: 28 Apr 2005 Posts: 99
|
|
|
|
Thank you.. :-) |
|
Back to top |
|
|
badal
New User
Joined: 05 Sep 2004 Posts: 21
|
|
|
|
Hi,
I do appriciate Aditya.
thanks for nice concepts.
do the same.
bye |
|
Back to top |
|
|
dilipbiradar
New User
Joined: 12 Jan 2007 Posts: 18 Location: Pune (India)
|
|
|
|
HI,
In case we have RAJAN after RAJAN in a row (6 to 10)would it help? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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.
|
|
Back to top |
|
|
|