Another approach that you should be aware of is doubling the quote character where needed.
data abcd;
col1="ABC 'DEF";output;
col1="ABCABC";output;
run;
data abc;
set abcd;
where col1='ABC ''DEF';
run;
The quote in blue is two single quotes.
You will want to know this because if you manage to acquire a string with both single and double quote marks then you would still have the issue. Consider searching for something like 5' 8" . Then either '5' 8"' or "5' 8"" will have a problem. The two quotes together are the solution in that case:
data abcd;
col1="ABC 'DEF";output;
col1="ABCABC";output;
col1="5'12""";output;
run;
data abc;
set abcd;
where col1="5'12""";;
run;
Look at the abcd set to verify that there is only one double quote in the last value.