Hi SAS users,
Need a help !
I have a macro that is resolving to client as abc in the log.But when i call that in a macro, i am getting the below error.
client is resolving correctly like example abc.
%macro &client._call (parms = );
ERROR: Invalid macro name &. It should be a valid SAS identifier no longer than 32 characters.
ERROR: A dummy macro will be compiled.
Thanks,
Ana
Hi, are you trying do define a macro called abc_call (parms = ) or do you want to call the macro that is called abc_call? I am not sure if you can create a sas macro program name based on macro variables. But, that is just my guess. But, if you want to call a predefined macro based on a macro variable, that seem to be working.
%let client=abc;
%macro abc_call (parms = );
%put This is the inparameters &=parms;
%mend;
%&client._call(parms=Hello World);
Looks like you are confusing defining a macro and calling a macro. You use the %MACRO statement only when defining the macro. You have to give the macro an actual name when you defined it.
%macro mymacro; ... %mend;
But you could use a macro variable to resolve to the name of the macro you want to call.
%let want_to_call = mymacro;
%&want_to_call;
Hi, are you trying do define a macro called abc_call (parms = ) or do you want to call the macro that is called abc_call? I am not sure if you can create a sas macro program name based on macro variables. But, that is just my guess. But, if you want to call a predefined macro based on a macro variable, that seem to be working.
%let client=abc;
%macro abc_call (parms = );
%put This is the inparameters &=parms;
%mend;
%&client._call(parms=Hello World);
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.