Date: Fri, 11 Feb 2005 19:07:54 +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: <A1AC89FF6C6A3B4EAB7098604553ECFA01D5AF2C@bskp7csgmsx01.pcl.ingenix.com>
Content-Type: text/plain; format=flowed
Bill,
Because %if-%then works at macro execute time and the 'in' would apply to
open SAS code execute time.
Toby Dunn
From: "West, Bill" <Bill.West@I3MAGNIFI.COM>
Reply-To: "West, Bill" <Bill.West@I3MAGNIFI.COM>
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: Problem with in operator
Date: Fri, 11 Feb 2005 13:51:04 -0500
This is probably equally studid answer but why not KISS:
arrary years fyear1 fyear2 ;
%do i = 1 %to dim years;
%if years {i} in (1988,1993,1999,2004) %then ...;;
%else .......;;
%end;
Bill West, Ph.D.
Research Analyst
i3 Magnifi
275 Grove Street
Auburndale MA
Direct: (617) 552 5232
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of
Paulo Alves
Sent: Friday, February 11, 2005 12:57 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Problem with in operator
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?