"Is this macro statement also defining yymmdd as a macro variable?"
Intuitively yes, but we can of course not say without knowing what the macro does.
Add the following options before the macro call:
options mprint symbolgen mautolocdisplay;
The mprint will print the macro definition to the SAS log, symbolgen will print to the log to what the macro variables resolve and mautolocdisplay will print where the macro is stored so you know where you can find the macro source code for further investigation.
Yes. According to the %MACRO Macro Statement, the parameter list:
names one or more local macro variables whose values you specify when you invoke the macro. Parameters are local to the macro that defines them. You must supply each parameter name; you cannot use a text expression to generate it. A parameter list can contain any number of macro parameters separated by commas. The macro variables in the parameter list are usually referenced in the macro.
Maybe an oversight
@HeatherNewton wrote:
%macro genstage(yymmdd)
but that should have a semi-colon on the end, or it will generate an error and will not create a macro variable by that name.
%macro genstage(yymmdd);
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.