I need to pass a variable that contains spaces to a macro. And use this variable to make some logic and to buid a new column inside the macro.
I've tried something like:
%MACRO func(var);
if first.id then &var = 0;
retain &var;
if descr = %unquote(%str(%'&var%')) then &var = 1;
%MEND;
proc sort data=work.table5a;
by id;
run;
data temp;
set work.table5a;
by id;
%func(PLUTO)
%func(PAPERINO)
%func(BANDA BASSOTTI)
if last.id;
run;
ERROR is:
NOTE: Line generated by the macro variable "VAR". 37 BANDA BASSOTTI _____ 180 ERROR 180-322: Statement is not valid or it is used out of proper order.
If i comment %prova(BANDA BASSOTTI) it works. Any suggestions ?
thanks