Hello Experts,
I would like to get the year 2020 in macro varaible "annee" but my code doesn't work:
%let annee=%sysevalf(year(%sysevalf(today()));
Thank you for your help!
Best regards
%SYSEVALF is for doing non-integer calculations in macro.
To call data step functions in macro language, you need %SYSFUNC.
%SYSEVALF is for doing non-integer calculations in macro.
To call data step functions in macro language, you need %SYSFUNC.
%let annee=%sysfunc(today(),year4.);
%put annee=&annee ;
Try this code:-
/*method1*/
data _null_;
call symputx('annee',put(intnx('year',today(),0),year4.));
run;
%put &annee;
/*method2*/
%let annee=%sysfunc(today(),year4.);
%put &annee;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.