sas Creating Macro Variables Using %LET


Example

I would describe %LET as being the most simple way to creating a Macro Variable in SAS.

%LET variableName = variableValue;

Now, anywhere you use &variableName, it will resolve to variableValue.

NOTE:you may want to consider that variableValue all on its own might bring you syntax errors, depening on what the value is and how it's used. For example, if it is a date and you're using it in the WHERE of a PROC SQL statement, it will need to be written as "&variableName"d to work properly.