Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what the last "." after the macro variable mean

Tags:

sas

Below is the code to create the dataset from exisitng datasets, where end and end8, end7 are macro variables, just wondering why add . at the end of the macro variables?

data tab4a_&end.;
set 
mck_tab4a_&end8.
mck_raw.mck_tab4a_&end7.
run;

1 Answers

The dot marks the end of the macro variable. It is often used when macro text is combined with static text, e.g. in a filename, so that SAS knows where the macro variable ends. E.g.:

%let year=2017;

%let filename = &year._accounts.xlsx;

%put &filename;

Produces 2017_accounts.xlsx

Without the first dot, SAS will produce a warning message, because it will be looking for a macro variable called year_accounts. (It can't tell where the macro ends and the text starts).

If there is a space or an end of statement after the macro variable then the dot can be omitted. Including the dot has no effect in this case. Some people think it is good to always include the dot.

like image 85
david25272 Avatar answered Dec 10 '25 20:12

david25272



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!