Hi everyone,
I have a problem filtering a date based on the format new_date monyy5.;
I have variables that have that format and I want to pull the data based on the month that they land on.
I tired to do something like this
data X;
set Y;
where new_date='SEP19'd;
run;
keeps telling me that I have an invalid date/time/datetime constant - why is that?
Because you need to use the underlying value, not the formatted value.
Or convert to the formatted value.
data X;
set Y;
where put(new_date, monyy5.)='SEP19';
run;
@sasxii wrote:
Hi everyone,
I have a problem filtering a date based on the format new_date monyy5.;
I have variables that have that format and I want to pull the data based on the month that they land on.
I tired to do something like this
data X;
set Y;
where new_date='SEP19'd;
run;
keeps telling me that I have an invalid date/time/datetime constant - why is that?
underlying value?
so I tried using that as well which was a datetime. format - which consisted of
data X;
set Y;
if DATE >= '01SEP19:20:55:00'd and DATE <= '30SEP19:20:55:00'd;
run;
and it doesnt pull up anything, why would that be the case?
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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 save with the early bird rate—just $795!
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.