BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Tom
Super User Tom
Super User

What types of values do STARTDATE and LASTDATE contain?

Are they date values so that the difference is in days?

Or are they datetime values so that the difference is in seconds?

jcis7
Pyrite | Level 9
Q1: What types of values do STARTDATE and LASTDATE contain?

A1: Start date I entered programmed into SAS as: startdate= '05-SEP-2017'd; but converts to 21067 in the SAS dataset

lastdate is a SAS date (datetime imported from MS Access (so it looks like in the SAS dataset 18APR2012:00:00:00 at first and then I converted to SAS date using datepart below so it becomes a SAS date) An example of lastdate is: lastdate=19254

Q2: Are they date values so that the difference is in days?

A2: They are in datetime in MS Access but when I imported to SAS, I used datepart to convert it to SAS day in an array called newdates:
do i=1 to dim(date);

newdate(i)=datepart(date(i));

end;

Q3: Or are they datetime values so that the difference is in seconds?

A3: They are in days.




hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 16 replies
  • 3147 views
  • 4 likes
  • 4 in conversation