Hello
%let TodayP='20Aug2018'd;
What is the way that TodayP parameter will get date value of today automatically?
thanks
Joe
%let today = %sysfunc(today(), yymmddn8.);
%put &today;
%let today = %sysfunc(today(), yymmddn8.);
%put &today;
And if you just need that for use in code:
if mydate le &todayp. then .....
then omit any formatting altogether:
%let TodayP=%sysfunc(today());
Date and time values only need formats when used for display. See Maxim 28.
Why would you need to create your own parameter? SAS already provides numerous methods to get today's date and time in whatever format you need. Do not create macro variables and code just for the sake of it!!
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 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.