Date: Wed, 12 May 2010 10:11:22 -0500
Reply-To: "Data _null_;" <iebupdte@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Data _null_;" <iebupdte@GMAIL.COM>
Subject: Re: Stupid Human Do-Loop Trick
In-Reply-To: <201005121456.o4CAl7ES030774@malibu.cc.uga.edu>
Content-Type: text/plain; charset=ISO-8859-1
I would call this
of x1-x3 x4-x6
a "list of variables" composed of two "SAS Variable Lists".
http://tinyurl.com/mtumkg
http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a000695105.htm
On 5/12/10, Chang Chung <chang_y_chung@hotmail.com> wrote:
> On Tue, 11 May 2010 16:00:03 -0700, Choate, Paul@DDS
> <Paul.Choate@DDS.CA.GOV> wrote:
>
> >Hey Chang -
> >
> >I wasn't saying the "of" parameter doesn't work as intended, it just needs
> to be explicitly stated after each comma - the "of" affects only the list
> prior to the next comma. Maybe a better example would be:
> >
> >data _null_;
> >x1=2; x2=2; x3=2;
> >x4=2; x5=2; x6=2;
> >sum1=sum(of x1-x3, x4-x6);
> >sum2=sum(of x1-x3, of x4-x6);
> >sum3=sum(of x1-x3 x4-x6);
> >put (_all_)(=);
> >run;
> >
> >SAS uses commas to control the actions of the SUM function OF keyword like
> it delimits the parameter list in the DO statement was my point.
>
> Hi, Paul,
>
> Ah, ha! this makes sense. I guess that the surprising part was sum3
> where two variable lists appears after the of keyword, since the 9.2
> documentation reads as if the of keyword should be followed by
> *one* variable list only. The documentation reads:
>
> SUM(argument, argument, ...)
>
> argument
> specifies a numeric constant, variable, or expression.
> If all the arguments have missing values, the result is a
> missing value. Otherwise, the result is the sum of the
> nonmissing values. The argument list can consist of
> a variable list, which is preceded by OF.
>
> Cheers,
> Chang
>
|