I have 30 different datasets in SAS and I would like to merge each one of them with a standard one I have. I am trying to write a macro to do that automatically for me. Unfortunately my macro (see below) does not work and I am not sure why this is the case. I get an error message:
WARNING: Apparent symbolic reference DISEASE_CLINIC not resolved.
ERROR 22-322: Expecting a name.
ERROR 200-322: The symbol is not recognized and will be ignored.
create table test.&disease_clinic as
from test.clinical_diagnosis left join test.&disease
SAS is expecting a macro variable named Disease_clinic to have been defined.
If you are wanting to use the name of the variable concatenated with _clinic the syntax should be:
create table test.&disease._clinic as
SAS uses a period to indicate the end of the macro variable name when used in compounds such as this.