The caller needs to protect the characters that cause issues for the macro language. You will also have trouble with commas in the value of that parameter.
The easiest way to protect with macro quoting is the %BQUOTE() function as it will handle the unbalanced quotes.
%education(%bquote(University Bachelor's),8)
You could design your macro to assume the value is quoted already in the call. And then because the value is quoted in the call the extra single quote does not cause any issues.
%macro education(education, ORDER);
data education;
set history_education;
where education=&education;
run;
%mend ;
%education("University Bachelor's",8)
You could even make the macro smart enough to add quotes if they are not already there, but the bottom line is it is the macro callers responsibility to type a command that SAS can parse.
... View more