Date: Wed, 4 Aug 2004 10:52:11 -0700
Reply-To: "Choate, Paul@DDS" <pchoate@DDS.CA.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Choate, Paul@DDS" <pchoate@DDS.CA.GOV>
Subject: Re: Proc Sort Sum statement MVS - note FYI
Content-Type: text/plain; charset="iso-8859-1"
Hi again SAS Aficionados-
After an inspiring offline email exchange with Toby Dunn we independently
arrived at two ways to circumvent this circumvention:
PROC sort DATA=dataset(SORTEDBY=_NULL_);
or
PROC sort DATA=dataset FORCE;
Both cause Proc SORT to correctly use the unduplicating and summing ability
of Syncsort when the data is presorted.
Cheers!
Paul Choate
DDS Data Extraction
(916) 654-2160
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Choate,
Paul@DDS
Sent: Wednesday, August 04, 2004 9:04 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Proc Sort Sum statement MVS - note FYI
Hi All,
As recently discussed on SAS-L; Proc Sort on MVS with Syncsort installed has
a lightning fast undocumented sum statement that works something like a Proc
Summary/Means Output Sum= statement.
The proc:
Proc sort;
By var1 var2;
Sum nvar3;
unduplicates the data on var1 and var2 and creates a sum for the nvar3's at
each unique by level. It runs much faster than Proc Means or Summary.
I just found that if the data is previously sorted on Var1 and Var2 then the
sum function does not operate (no unduplication or sum), but instead the
dataset is simply copied, overriding the sum command.
If you change the sort order, for example use "descending Var2", then the
sort sum works as expected.
Regards to all -
Paul Choate
DDS Data Extraction
(916) 654-2160