a macro works good when running when it is used in general sense, %Count(inds=ADRS, paramcd=OVRLRESP, avalc=SD) ; then I wish to run this macro from a table named NL like below: paramcd avalc OVRLRESP SD OVRLRESP PD
data _null_ ;
set nl ;
cmd= "%Count(inds=adrs, paramcd='"||strip(paramcd)||"', avalc='"||strip(avalc)||"');" ;
rc2=dosubl(cmd);
run;
Reading the log, there are these message:
MLOGIC(COUNT): Beginning execution.
MLOGIC(COUNT): Parameter INDS has value adrs
MLOGIC(COUNT): Parameter PARAMCD has value '"||strip(paramcd)||"'
MLOGIC(COUNT): Parameter AVALC has value '"||strip(avalc)||"'
;
Would anyone suggest me what wrong I have made?
Don't double quote the text used to construct the macro call. When in double quotes the macro will be called (attempted) as the step is getting delivered to the supervisor for compilation.
Example:
Single quote the macro call in the statement being assembled as source code text.
For clarity you can use a tokenized template and
transtrnto resolve the template