Tutorial by Examples

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, ...
Using PROC SQL is a good way to get quick results from a table and throw them into variables. I usually find that when I want to get a count of records I just loaded to a table, I can get that count into a variable with a quick PROC SQL call. PROC SQL; SELECT COUNT(*) INTO:aVariable FROM ...
DATA _null_; CALL SYMPUT('testVariable','testValueText'); ;RUN; In the example above, %PUT &testVariable; will resolve to testvalueText. You may find the need to format your variable within the SYMPUT() call. DATA _null_; CALL SYMPUT('testDate',COMPRESS(PUT(today(...

Page 1 of 1