The pointer motion is only needed in this case because of the use of the %BQUOTE() function in the generated code. That would quote the trailing space making it part of the value passed to the macro. Since I don't have your macro I am not sure if that extra space would make a difference. Normally in generated SAS code an extra space is not an issue.
If you name your macro parameters after your dataset variables (or visa versa) then PUT statement is even easier. So if your macro had two parameters named VAR1 and VAR2 then your metadata dataset should have two variables named VAR1 and VAR2.
So a program like this:
data _null_;
set metadata ;
file code;
put '%macro_name(' var1= ',' var2= ')';
run;
Will create code like:
%macro_name(var1=ABC ,var2=xyz )
%macro_name(var1=DEF ,var2=123 )
Remember that even if you define your macro to allow the parameters to be specified by position only (like: %my_macro(ABC,xyz) ) you can still use the parameter names in the call to the macro (like: %macro_name(var1=ABC ,var2=xyz ) ).
... View more