LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 2005, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 18 Aug 2005 12:15:36 -0500
Reply-To:   Russell D Newhouse <NEWHOUSE_RUSSELL_D@LILLY.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Russell D Newhouse <NEWHOUSE_RUSSELL_D@LILLY.COM>
Subject:   Re: "SAME" a reserved word?
In-Reply-To:   <1124384459.864281.51160@g49g2000cwa.googlegroups.com>
Content-Type:   text/plain; charset="US-ASCII"

SAME-AND is an operator in the WHERE Statement.

From the V8 OnlineDoc:

Using SAME-AND: where year>1991; ...more SAS statements... where same and year<1999; In this example, the second WHERE statement is equivalent to the following WHERE statement: where year>1991 and year<1999;

Barbara R <rubarb@YAHOO.COM> Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> 08/18/2005 12:00 PM Please respond to Barbara R <rubarb@YAHOO.COM>

To SAS-L@LISTSERV.UGA.EDU cc

Subject "SAME" a reserved word?

Hello all,

It seems (see below) that "same" is not a good variable name. It sort of works, but I can't use a Where statement. Can anyone explain to me what the problem is or where I might look in SAS documentation to find out more?

Thanks for any help you can provide!

---------------------------------------------- 2041 data test;input a b c; 2042 same=(a=c); 2043 cards;

<data> 1 2 3 2 3 2 1 5 2 1 4 1

NOTE: The data set WORK.TEST has 4 observations and 4 variables. NOTE: DATA statement used (Total process time):

2048 ;run;

2049 data test2; set test; 2050 where same=1; - 22 76 ERROR: Syntax error while parsing WHERE clause. ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant, a missing value, INPUT, PUT.

ERROR 76-322: Syntax error, statement will be ignored.

2051 ;run;

NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.TEST2 may be incomplete. When this step was stopped there were 0 observations and 4 variables. WARNING: Data set WORK.TEST2 was not replaced because this step was stopped.

2052 data test3; set test; 2053 if same=1; 2054 ;run;

NOTE: There were 4 observations read from the data set WORK.TEST. NOTE: The data set WORK.TEST3 has 2 observations and 4 variables. NOTE: DATA statement used (Total process time):

2055 data test;input a b c; 2056 tame=(a=c); 2057 cards;

NOTE: The data set WORK.TEST has 4 observations and 4 variables. NOTE: DATA statement used (Total process time):

2062 ;run; 2063 data test2; set test; 2064 where tame=1; 2065 ;run;

NOTE: There were 2 observations read from the data set WORK.TEST. WHERE tame=1; NOTE: The data set WORK.TEST2 has 2 observations and 4 variables. NOTE: DATA statement used (Total process time):


Back to: Top of message | Previous page | Main SAS-L page