LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2005, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: Bill.West@I3MAGNIFI.COM
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?


Back to: Top of message | Previous page | Main SAS-L page