Hi,
How do I subset data based on a time variable? The variable has the time format which makes it look like "21:36:00." I want anyone between 7pm and 12pm?
Num | 8 | TIME. |
use time constant
where time_variable between '7:00pm't and '12:00pm't;
use time constant
where time_variable between '7:00pm't and '12:00pm't;
Do you know if there is a way to combine a date variable and a time variable to create a Datetime variable?
@lalaktgrau wrote:
Do you know if there is a way to combine a date variable and a time variable to create a Datetime variable?
The dhms() function. Use the date as the first and the time as the fourth parameter; set the second and third parameter to zero.
12 pm is (per definition) noon, so your rule would include everything from 19:00 on one day to 12:00 on the next.
I rather guess you want to include everything between '19:00:00't and '24:00:00't;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: