BookmarkSubscribeRSS Feed
d_simpson
Calcite | Level 5

SAS does not let me assign 29-Feb-4000 as a valid date.

Tt looks like it is defining years divisible by 4000 as not leap years. I think this is incorrect.

I tried 29-FEB-8000 and that generates an error too.

28 a_date = '29FEB4000'd; output;
____________
77
ERROR: Invalid date/time/datetime constant '29FEB4000'd.
ERROR 77-185: Invalid number conversion on '29FEB4000'd.

4 REPLIES 4
PaigeMiller
Diamond | Level 26

According to this article, 4000 is not a leap year.

--
Paige Miller
d_simpson
Calcite | Level 5
I understand that the 4000 rule is still a proposal though.

PaigeMiller
Diamond | Level 26

Well, that is how SAS handles leap years. I read somewhere that in Excel, 4000 is a leap year.

--
Paige Miller
ballardw
Super User

One might ask why is so important to have a 29 Feb 4000 date. or 8000, 12000, 16000?

 

Once the programming is set for the rules to exclude 4000 why might you think 8000 would be different.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1351 views
  • 0 likes
  • 3 in conversation