Hi:
Macro variables enclosed in SINGLE quotes do not resolve in the macro variable resolution process.
As I said, it is a bad idea to try to "pre-quote" macro variables in your %LET statement. The quotes belong in the WHERE statement, not in the %LET statement.
The quotes for a date constant do NOT have to be single quotes.
If you follow the general rules for creating macro variable references, you would have started with this -working- WHERE statement:
[pre]
WHERE somevar = 'value' and month ge '01May09'd;
--- then you you would have made a macro variable with a %LET and substituted
the macro variable for the text string 01May09 -- that's all.
You want that text string treated as a date constant, so the quotes and the d belong to the WHERE statement.
Then, you would have changed your program to create &MACVAR and then changed the WHERE to:
%let macvar = 01May09;
WHERE somevar = 'value' and month ge "&macvar"d;
---with the quotes in the WHERE Statement, where they belong. You only would have needed to change the single quotes
from the first WHERE statement to double quotes for the second version in order for the macro variable to resolve.
[/pre]
I'm sorry if my previous explanation was not clear. As it says here, in the documentation:
http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a001071889.htm
"Macro variable references that are enclosed in single quotation marks are not resolved."
cynthia