Hello,
I am trying to reduce the data returned from a very large table by the date (Proc sql in SAS 9.4)
The format of the column is DDYYMM8. (Number)
In my where clause I have tried:
where date >= 01-01-16
where date >= 01/01/16
and the reverse eg 16/01/01 etc
All attempts so far have resulted in dates still being returned which are older than 01/01/16
Can anyone help please?
try this:
where date LE '01jan2016'd
All of the SAS date stored as numbers, counting days from 1/1/1960. So you either use the number of days directly, in this case, 20454 days from 1/1/1960, or tell SAS how to read it correctly, such as in the above example.
try this:
where date LE '01jan2016'd
All of the SAS date stored as numbers, counting days from 1/1/1960. So you either use the number of days directly, in this case, 20454 days from 1/1/1960, or tell SAS how to read it correctly, such as in the above example.
Thank you for this it's worked perfectly!
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.