Withus,
When Reeza suggested this:
where date between "&year-01-01" and "&year-12-31"
Did you realize that he is using double quotes, and not two single quotes? Did you actually use double quotes and have the program still fail?
Reeza is She.
Sory to add to your mail Astounding, you would still need to have the letter d after your date literals, e.g. "&year-01-01"d
Otherwise the where is trying to compare numeric date to two characters which wont work
The OP states it's a character variable.
My date variable is string.
So the where is all wrong then:
from:
where Date between '&year-01-01' and '&year-12-31';
to (assuming per the other dates that my date is yyyy-mm-dd):
where input(Date,yymmdd10.) between "&year-01-01"d and "&year-12-31"d;
I tried, shown below:
"input(DOS, yymmdd10.)" then I got an error message: Invalid date/time "2013-01-01"d
"01Jan&year."d. ....and another error: different data types.
For your convenience I posted fake data and code above.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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: