A database date or timestamp might be read into SAS as a different value than what is stored in the database


SAS does not support date values earlier than 01JAN1582 and datetime values earlier than 01JAN1582:00:00:00. If you try to read in a date or timestamp variable stored in a database with a value earlier than 01JAN1582 or 01JAN1582:00:00:00, SAS should set the variable to missing

However, the variable might be set equal to the value of a preceding row with the following releases of SAS® 9.4 and SAS® Viya®:

For example, the input data below contains the following date values (in the format of yyyy-mm-dd):

0001-01-01
2026-07-17
0001-01-01
2011-04-14
0001-01-01
0001-01-01
2004-06-23

You expect the following values when the dates are read into SAS:

.
17JUL2026
.
14APR2011
.
.
23JUN2004

However, if those rows were read into SAS in that order, the results might look similar to the following:

.
17JUL2026
17JUL2026
14APR2011
14APR2011
14APR2011
23JUN2004

The actual results might vary each time you execute the query and are based on the actual query being executed. 

There is no workaround for this issue.