Date: Mon, 3 Nov 2008 15:23:41 +1100
Reply-To: Scott Bass <sas_l_739.at.yahoo.dot.com.dot.au@PESTO.CC.UGA.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Scott Bass <sas_l_739.at.yahoo.dot.com.dot.au@PESTO.CC.UGA.EDU>
Subject: Re: A SAS macro variable question
Try using a space for the delimiter per the documentation.
You don't need the quotation marks, since macro is text tokens that are
resolved before the program is compiled.
So try something like
%if (&ds in apple pear orange) %then %do; %put IT WORKED; %end;
""A.B."" <alicia.bingo@GMAIL.COM> wrote in message
> I have a simple macro that I use to create dataset. In the macro I check
> see if the variable name is in a list of strings:
> %macro mydata(ds);
> %if "&ds" in ("apple", "pear", "orange") %then
> The macro variable was resolved correctly, but SAS gave the following
> ERROR: Required operator not found in expression: "&ds" in ("apple",
> ERROR: The macro MYDATA will stop executing.
> This seemed working OK in SAS 9.1 but not in SAS 9.2. Can anyone tell me
> what might be the problem?