TABLE NOTE 8:
An exception to this rule occurs when two comparison operators surround a
quantity. For example, the expression x<y<z is evaluated as (x<y) and (y<z).
in the section on evaluation of expressions from the online documentation.
= also obeys the exception noted above as do all the comparison operators.
Reason: Probably too much C in your background, or too great a desire for
From: goldbergj@MSNOTES.WUSTL.EDU [mailto:goldbergj@MSNOTES.WUSTL.EDU]
Sent: Thursday, July 25, 2002 4:43 PM
Subject: Re: Double Assignment
Sigurd Hermansen <HERMANS1@WESTAT.COM> says:
I would not trust a programmer who leaves out the parentheses. What rules
operator precedence apply in multiple assignments across the same operator?
Try to explain how SAS will evaluate
to someone other than a committed (or soon to be) SAS programmer!
Try to explain it to me! According to the documentation, = is a group 5
operator, and pairs are evaluated left to right. If so, explain:
1 data _null_;
2 v1 = 7;
3 v2 = 7;
4 v3 = v1=v2=7; *should be 0;
5 put v3=;
4 v3 = v1=(v2=7); *should be 0; or
4 v3 = (v1=v2)=7; *should be 0;
I thought I understood this; obviously I'm overlooking something.
Missouri Alcoholism Research Center
Washington University School of Medicine
40 N. Kingshighway, Suite One
St. Louis, MO 63108