What does double brackets mean??
I see this in my sas program that I dont recognise:
sme=((Customer_type='C')):
how could the above be interpreted?
You should interpret this as a boolean expression, meaning that it will return either 0 (FALSE) or 1 (TRUE). Programmers tend to use brackets to indicate a boolean expression, though usually, they are not necessary. In this case, the double brackets certainly are not necessary .
See the small example below.
data _null_;
a = (1 = 2);
b = (2 = 2);
put (a b)(=);
run;
@christinawkhau wrote:
What does double brackets mean??
I see this in my sas program that I dont recognise:
sme=((Customer_type='C')):
how could the above be interpreted?
Often when I see code with duplicated () I suspect either code editing, where some other element was present in the code such as below an removed OR thinking that such an addition was considered but not implemented.
sme=((Customer_type='C') and (othervar = something)):
The intent would be to force a dichotomous 1/0 valued result for the comparison.
If you haven't see that type of coding it is sometimes used in place of
If Customer_type='C' then sme= 1; else sme=0 ;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.