BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
maliksmom2000
Obsidian | Level 7

I am trying to return an actual date or if date is missing I want a blank or even a 0.  It's returning the actual date or 1/1/1960

 

Here is my expression:  ifn(t1.GNN_MSAI_ANCHOR_DT is missing, t1.Final_Anchor, t1.GNN_MSAI_ANCHOR_DT,0)

 

How do I change it so that it only returns the actual date or missing value as blank or 0?

 

**I should note the formula works and returns the date in sas date format (19844, etc.).  I get the 1/1/1960 when I try to change the format....MMDDYYw.d.

 

THANK YOU!!!!!

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

The raw value of 0 (zero) in a SAS date IS 1960-01-01, as that is the zero days for SAS date values. See About SAS Date, Time, and Datetime Values.

A SAS date value is never "zero"; it can be a displayable date, missing, or a non-displayable value (too far back in history or too far in the future).

View solution in original post

1 REPLY 1
Kurt_Bremser
Super User

The raw value of 0 (zero) in a SAS date IS 1960-01-01, as that is the zero days for SAS date values. See About SAS Date, Time, and Datetime Values.

A SAS date value is never "zero"; it can be a displayable date, missing, or a non-displayable value (too far back in history or too far in the future).

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 775 views
  • 0 likes
  • 2 in conversation