Date: Fri, 7 Oct 2005 16:54:26 -0400
Reply-To: Yihuan Xu <yihuan.xu@JEFFERSON.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Yihuan Xu <yihuan.xu@JEFFERSON.EDU>
Subject: %while condition
Hi, All,
I have problems in a %while condition statement.
Here is the program. When &c increased by integer, everything is OK, but
when it is a floating number, it gave me error messages as below. How to
solve this problem? Thank you very much.
SYMBOLGEN: Macro variable C resolves to -5.95
ERROR: A character operand was found in the %EVAL function or %IF condition
where a numeric operand is required. The condition was: &c. lt
&maxt.
SYMBOLGEN: Macro variable MAXT resolves to 3
ERROR: The condition in the %DO %WHILE loop, , yielded an invalid or
missing
value, . The macro will stop executing.
ERROR: The macro TEST will stop executing.
%macro test;
%let c=-6;
%let maxt=3;
%do %while( &c lt 6);
%let c=%sysevalf(&c+0.05);
%end;
%mend test;
%test;
|