Hi,
i have variable (Date) with dates such as 01MARCH2010 till 12 DEC2011.
How do i get only variables less than 10JUN2010. iam trying with this code, but it's not executing properly.
data flightdelays;set lib.flightdelays;where Date < 10JUN2010;run;proc print;run;
@TarunKumar wrote: T data flightdelays;set lib.flightdelays;if Date < '10JUN2010'n;run;proc print;run;
T
data flightdelays;set lib.flightdelays;if Date < '10JUN2010'n;run;proc print;run;
Do you really think @Raj00007 has a variable named
10JUN2010
?
The proper character for a date literal is d:
'10JUN2010'd
View solution in original post
Use a correct date literal:
data flightdelays; set lib.flightdelays; where Date < '10JUN2010'd; run;
You do not need to create a separate dataset, though; WHERE statements (or WHERE= dataset options) can be used in most procedures.
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 lock in 2025 pricing—just $495!
Register now
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.