Hi there, I would like some help with the following macro:
%let dt = %SYSFUNC(today(),MONYY.);
This outputs the result: MAY13
How can this code be modified to show the previous month? i.e. APR13?
Secondly, how can I make it look a bit different? Let's say like: April 2013
Thanks!
Thank you!
I do not know of a single format to get "April 2013" output. I think you will need to use two function calls.
%let dt = %sysfunc(intnx(MONTH,%SYSFUNC(today()),-1));
%let dt = %sysfunc(putn(&dt,monname.)) %sysfunc(putn(&dt,year.));
%let x=%sysfunc(nldate('01dec2013'd,%nrstr(%B %Y)));%put x=&x;
x=December 2013
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.