Last active
April 27, 2018 19:20
-
-
Save statgeek/386c48f7ce670b4212536d5f9ae6a2ed to your computer and use it in GitHub Desktop.
SAS - macro variables and calculations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*This is an example of doing calculations with a macro variable. | |
In this case, all integers allow us to use %EVAL(). Otherwise you | |
would need to use %SYSEVALF()*/ | |
%let HYR = 2018; | |
%Let Yr2 = %eval(&HYr. - 1); | |
%Let Yr5 = %eval(&HYr. - 4); | |
%put HYR: &hyr; | |
%put YR2: &yr2.; | |
%put YR5: &yr5.; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment