This should be an easy one, but I can't figure it out: there are situations where I need to create a macro variable from contents of a table, and they sometimes contain ampersands (&) as part of the text. How do I get SAS to ignore the ampersands when I call the macro variable? For example, this code...
data _null_;
test="Amos&Andy";
call symputx("testvar",test);
run;
%put testvar=&testvar;
...writes this to the log:
28 data _null_;
29 test="Amos&Andy";
WARNING: Apparent symbolic reference ANDY not resolved.
30 call symputx("testvar",test);
31 run;
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
WARNING: Apparent symbolic reference ANDY not resolved.
32 %put testvar=&testvar;
testvar=Amos&Andy
How can I get SAS to ignore the ampersand and not write the WARNING to the log? Thanks very much!