If you are providing the value for the prompts then make sure you provide a valid value. If the list of values includes the outer quotes like in your original example then any embedded quotes need to be doubled up.
So if the intent was to make a string that could be used with LIKE keyword to find any occurance of the word "don't" then the value the user should select is:
'%don''t%'
But if instead you are just letting the user pick values that are in some dataset then do NOT add any quotes in the user prompts. Instead you can add the quotes later in the SAS code that processes the values.
So let the user pick between values like
SAN'JUAN
NEW YORK
LONDON
Then in your SAS program add the quotes to convert the macro variable into a string literal that Oracle will understand. So if you just want to add the quotes you could do:
%let mvar=%sysfunc(quote(%superq(mvar),%str(%')));
Or you could also add the % for the LIKE operation at that time.
%let mvar=%sysfunc(quote(%str(%%)%superq(mvar)%str(%%),%str(%')));
If you are using an old version of SAS and the QUOTE() function does not support the optional second parameter then use TRANWRD() function to double up the embedded quotes.
%let mvar=%qsysfunc(tranwrd(%superq(mvar),%str(%'),%str(%'%')));
%let mvar=%unquote(%bquote('&mvar'));
... View more