Hi,
We are working on a 9.2 - EG installation. i was trying the following code.
data a;
format a date9. b date9.;
a=input('01-Apr-19',anydtdte9.);
b=input('01-Apr-20',anydtdte9.);
run;
the output that i get is
a=01apr2019
b=01apr1920
Why is it that for the first date the year comes as 2019 but for the second date the year comes as 1920. Any suggestions would be helpful.
Look up the option yearcutoff
The default is 1920 which you need to change for your dates.
Look up the option yearcutoff
The default is 1920 which you need to change for your dates.
Reeza already told you about the yearcytoff option for 2-digit years. Date9. expects DDMMMYY(YY) characters. In your example was 01 at the beginning representing day or year?
Reeza,
Thanks a lot..
Art,
The 01 represented the day.
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.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.