Date: Sat, 28 Jul 2001 08:12:18 -0400
Reply-To: Steve Rowe <steverowe@EMAIL.MSN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Steve Rowe <steverowe@EMAIL.MSN.COM>
Subject: Re: problem with characters in macro %if expression
Harry -
This solves one problem but creates anoter - if you assign
%let measure=GE;
it will fail - try it.
The other suggestions about %str() or "" BOTH SIDES will work.
On Fri, 27 Jul 2001 17:04:01 -0400, Droogendyk, Harry
<Harry.Droogendyk@CIBC.COM> wrote:
>Gabriel:
>
>SAS is getting confused by your literal 'GE', looks a lot like the operator
>for greater-than-or-equal-to. Add %str( ) around the literal and all will
>be happiness at Berkeley.
>
>%if &measure = %str(GE) %then %put measure is ge and measure is &measure;
>
>
>-----Original Message-----
>From: Gabriel [mailto:gabo@ECON.BERKELEY.EDU]
>Sent: July 27, 2001 4:41 PM
>To: SAS-L@LISTSERV.UGA.EDU
>Subject: problem with characters in macro %if expression
>
>I have a problem using logical expressions with the macro language. I
>have a line like this within a macro:
>
>%IF &MEASURE=GE %then %put measure is ge and measure is &measure;
>
>Now I know the macro variable MEASURE is set to FGT. When I run that
>line with options symbolgen selected, I get the following inthe log
>file:
>
>SYMBOLGEN: Macro variable MEASURE resolves to FGT
>SYMBOLGEN: Macro variable MEASURE resolves to FGT
>measure is ge and measure is FGT
>
>Why does SAS seem to think that &MEASURE=GE, when the output says
>otherwise?
>Thanks for the help!
>Gabriel
|