sas Creating Macro Variables Using Call Symput() in a DATA step

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

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(),date9.)));
;RUN;

In the example above,%PUT &testDate; will resolve to 10MAR2017



Got any sas Question?