Is there a way to assign a macro to an existing Parameter in EG so that it prompts the user for a date range? I have the parameter set in EG but not sure how to go about this or if it is even possible. I need to be able to edit the following code for a prompt screen.
It is generally a bad idea to "prequote" your macro variable values in the %LET statement. The quotes belong to the WHERE clause...
this is perfectly valid SAS code:
where birthday = "15Nov1950"d;
%let bday = 15Nov1950;
where birthday = "&bday"d;
the quotes around your date constant can be either single or double quotes. Putting the quotes, where they belong, in the WHERE statement or
clause, allows you to avoid "pre-quoting", using %str and possibly needing %unquote to undo the effects of %str.
I don't work with EG that much, so will defer to EG users on how to assign a macro variable a value with a parameter. But I believe that these
general rules for macro processing still hold:
1) have working code and put quotes in the working code where needed
2) DO NOT put quotes in your %LET statement
3) Once you have working code, replace the hardcoded values with macro variable references and test the code again
4) If you need macro conditional logic, take your macro-ized code and put it into a macro program for invocation.
5) Use only the "strength" of macro quoting function that you need. For example, if you need to prevent resolution of a macro variable at compile time,
don't use an execution time quoting function and vice versa. Do not use macro quoting functions unless you REALLY need them.