Date: Fri, 11 Feb 2005 19:04:55 +0000
Reply-To: toby dunn <tobydunn@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: toby dunn <tobydunn@HOTMAIL.COM>
Subject: Re: Problem with in operator
In-Reply-To: <1108144616.886745.154860@l41g2000cwc.googlegroups.com>
Content-Type: text/plain; format=flowed
Pauloalves,
The in operator in the context of the Macro facility would depend on your
version of SAS and I ussually see it something like the following:
%put %eval(a in a,b,c,d);
As to yoru second question yes consider the following example:
%macro test(var=%str(a,b,c));
%put &var ;
%mend;
%test
results in a,b,c in the log.
Toby Dunn
From: Paulo Alves <pauloalves74@HOTMAIL.COM>
Reply-To: Paulo Alves <pauloalves74@HOTMAIL.COM>
To: SAS-L@LISTSERV.UGA.EDU
Subject: Problem with in operator
Date: Fri, 11 Feb 2005 09:56:56 -0800
Sorry guys this one is a stupid one...
The database I am using has this odd thing of years with 53 weeks... do
not ask me why! the years with 53 weeks are (1988,1993,1999,2004)
I need to identify these years when running a macro
%do i = 1 %to &nYears;
%if %eval(&i+&FYear-1) %in (1988,1993,1999,2004) %then ...;;
%else .......;;
%end;
Variable Fyear=1984 and Nyears=21
I am getting the error
ERROR: Required operator not found in expression: %eval(&i+&FYear-1)
%in (1988,1993,1999,2004)
Another question...
Is it possible to pass the (1988,1993,1999,2004) as a parameter?