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).

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

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
  • 729 views
  • 0 likes
  • 2 in conversation