|
|
地板

楼主 |
发表于 2010-1-15 22:47:44
|
只看该作者
Re: 请教%symdel的用法
[code:8yuohn84]%let age=30;
%put &age;
%macro liu(var);
%if %symexist(&var) %then%do;
%put Before 1: macro variable "&var" exists;
%symdel &var;
%if ^%symexist(&var) %then %put After: macro variable "&var" deleted;
%end;
%else %put Before 2: macro variable "&var" not exist;
%mend;
%liu(age)
;
%put &age; %*won't be resolved;[/code:8yuohn84]
I cannot replicate exactly the same error message as yours, but I don't see any mistakes from your original code.
On the other hand, I guess, that error could be due to an earlier-than-expected resolved macro varible.
[quote:8yuohn84]ERROR: Macro variable name & must start with a letter or underscore.[/quote:8yuohn84]
I guess that was from %symdel & var; %*unnecessary blank space between;
[quote:8yuohn84]%symdel "&var";
ERROR: Macro variable name "AGE" must start with a letter or underscore.[/quote:8yuohn84]
This is clear here %symdel "&var"--->%symdel "Age" ---> incorrect nomination for a macro variable.
*****JingJu***** |
|