y*********4 发帖数: 76 | 1 I could use that successfully without macro as:
if (first.var1) then i=0;
but when I tried to write that in a macro
%if (first.var1) %then i=0;
it runs with error information: A character operand was found in the %EVAL
function or %IF condition where a numeric
operand is required. The condition was: (FIRST.RATERID)
btw, both var1 and i are not macro variables.
Is there anyone who know how to solve it?
Thanks a lot! |
a********s 发帖数: 188 | 2 You may also just use "if (first.var1) then i=0;" in the macro. |
h******e 发帖数: 1791 | 3 你有个dataset吗?没有dataset谈何first.var呢?或者你认为%if应该用于在macro的
dataset里?那就错了。 |
a********s 发帖数: 188 | 4 Exactly. In a macro, if you just do
data xxx;
set xxx;
if(first.var1) then i=0;
run;
You do not need to use %if...
【在 h******e 的大作中提到】 : 你有个dataset吗?没有dataset谈何first.var呢?或者你认为%if应该用于在macro的 : dataset里?那就错了。
|
y*********4 发帖数: 76 | 5 I actually just figured out...
but thank you guys so much.
【在 a********s 的大作中提到】 : Exactly. In a macro, if you just do : data xxx; : set xxx; : if(first.var1) then i=0; : run; : You do not need to use %if...
|