|
Kevin,
If I recall correctly earlier posts by Ian W. have gone into detail on
the circumstances when the SAS macro processor implicitly invokes %eval.
When that is the case, comparisons to null macro variables fail with
the message that you've received. Alternatives are to use macro
quoting, which has the effect of masking the null macro value, or to use
the alternate condition %length(&match) = 0
HTH, Ken
>>> "Kevin Roland Viel" <kviel@EMORY.EDU> 12/22/03 12:46PM >>>
Macro oracles,
I have the following code which, despite &MATCH producing a value
with a %PUT statements, yields this message:
ERROR: A character operand was found in the %EVAL function or %IF
condition where a numeric operand is required. The condition was:
&Match.=
I have replicated this structure in a simplify test macro without
producing the above mentioned thorn. If I use the statement %if
%eval(%quote(&match.)=" ") all seems to go well. Any suggestions?
%if %sysfunc(exist(ds))=1 %then
%do;
%let Match=%str( );
data _null_;
do until (match="1" | end);
set ds end=end;
if Directory="&path." then
do;
match="1";
call symput("Match", trim(Directory));
end;
end;
run;
%if &Match. = %str( ) %then %do; %end; /*This is the suspect
line*/
Thanks,
Kevin
Kevin Viel
Department of Epidemiology
Rollins School of Public Health
Emory University
Atlanta, GA 30322
|