Hi @kiranp
You can't use a macro inside a data / a proc step.
Here is something you can do :
%macro test (tabin = , tabout = );
data &tabout;
set &tabin;
if amount<0 then amt_cat=0;
else if 0<amount<100 then amt_cat=100;
else if amount >=100 then amt_cat=1000;
run;
%mend test;
%test (tabin = sashelp.buy, tabout= work.want);
This code includes to macro parameter (the input table, the output table) that you specify when you call the macro %test.
In addition, I think there is a misunderstanding of the Libname statement -> 'a' is a library (like a virtual folder) and not a dataset.
Best,
... View more