Hi,
If someone what to use an apostrophe in a macro parameter, he has at least 3 ways to specify it in the macro call
%macro demo (text1);
%put text1= &text1.;
%mend demo;
%demo(%str(I don%'t know));
or
%macro demo (text1);
%let text1=%qsysfunc(dequote(&text1.));
%put text1= &text1.;
%mend demo;
%demo("I don't know");
%demo('I don''t know');
Now, assuming that we want to use two apostrophes (which resolve to one) in the macro parameter, what should be done to display the macro parameter value?
Expected result:
text1= I don't know
I could think of this solution. Would you have any other suggestion?
%macro demo (text1);
data _null_;
call symputx('text1',tranwrd(dequote("&text1."),"''","'"),'L');
run;
%put text1= %bquote(&text1.);
%mend demo;
%demo(I don''t know);
Cheers