Hi Experts,
When i submitt the below statements it gets resolved to February.
%let %SYSFUNC(TODAY(), Monname.);
Resolves to February
However when i try to provide date value manually below statement gives error, Could you please let me know why it is giving error and how can it be resolved.
%Let D=%EVAL("24FEB2016"d);
%PUT %SYSFUNC(&D,Monname.);
Thanks in advance.
Regards,
Varun
%sysfunc requires a function in the first parameter and an optional format for the second parameter.
You're not using a function for the first parameter. If you use PUTN then you don't need the second parameter.
This resolves as expected:
%Let D="24FEB2016"d;
%put %sysfunc(putn(&d, monname.));
%sysfunc requires a function in the first parameter and an optional format for the second parameter.
You're not using a function for the first parameter. If you use PUTN then you don't need the second parameter.
This resolves as expected:
%Let D="24FEB2016"d;
%put %sysfunc(putn(&d, monname.));
Hi @varunk,
The first error message ("A character operand was found in the %EVAL function ...") is due to the fact that %EVAL cannot cope with date literals. To store the numeric SAS date value corresponding to the date literal in the macro variable, you can use the %SYSEVALF function:
%let d=%sysevalf("24FEB2016"d);
%put &d;
/* 20508 */
Reeza explained the second error message ("Function name missing in %SYSFUNC ...").
thanks for all your help.
Thanks for all your help
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.