Show the actual numeric value of the variable with a BEST16. format applied.
Show/describe how you show the year value you say is incorrect.
Typically this sort of thing comes from either an incorrectly built date value, something not actually a date but you think it is, or values out side of your expected range.
Have you accidentally applied a SAS date format to the number that Excel uses to store dates? Excel and SAS use different starting days for counting the number of days.
You can correct an Excel date into a SAS date by adding the date 30DEC1899 (which will be a negative number since SAS counts dates from 1960).
284 data _null_; 285 date=mdy(12,31,2020); 286 put date= date9. date=comma12. ; 287 date=mdy(1,1,2081); 288 put date= date9. date=comma12. ; 289 date=date+'30dec1899'd; 290 put date= date9. date=comma12. ; 291 run; date=31DEC2020 date=22,280 date=01JAN2081 date=44,196 date=31DEC2020 date=22,280
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.