Dynamically call macro from sas data step

This in part depends on what your macro is doing. If we assume that your macro is doing something that is intended to be run outside of a data step (ie, it’s not just assigning a data step variable), then you have several options. CALL EXECUTE PROC SQL: SELECT INTO macro variable Write macro calls … Read more

Why won’t my macro variable resolve?

Macro variables in SAS won’t resolve when they are in single quotes, ‘&myvar’. They need to be in double quotes, “&myvar”, in order to resolve properly. If you need to have single quotes and a resolved macro variable, you have a few options, but the simplest is: %str(%’&myvar.%’) The %’ inside of %str will place … Read more