05-22-2018 09:23 AM
When department has the value of Dean's Office. The below errors
%if &department ne %then %do;
ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: &department ne
ERROR: The macro DEPARTMENTWHERE will stop executing.
What can I use to allow the if statement to work?
05-22-2018 09:49 AM - edited 05-22-2018 09:50 AM
What is the difference between '' and "" here?
I think a the use of most functions around the parameter work work in this case. I need the macro to print out a dynamic report.
05-22-2018 09:58 AM
Has to be double quotes for the macro variable to resolve. Also, if you used single quotes it would be unbalanced. Just think about what is resolved:
%if "Dean's Office" ne "" %then %do;
"I need the macro to print out a dynamic report." - the point is? Many simple methods, categorise the data using numerics rather than text, use by group processing, combine categorisation and by group processing, generate code from datastep. Reason I ask is that as soon as you fix the code to handle ', you can almost guarentee that the next run will include a ", or some other strange character. Datasets can handle this fine, macro is really not good at data processing.
Need further help from the community? Please ask a new question.