Why does the "want" for Horsepower show a line break after "text"? That's going to be a serious difference of logic if intentional.
Where do you expect this to display? Is this only for the log or elsewhere? I'm not sure that the unicode characters display well in the LOG.
Any particular reason you didn't use the NEWLINE function instead of the unicode character? Not that the LOG likes that any better in a macro variable.
Here's an example, that depending on your settings may display something similar to what you want in the results window using FILE PRINT with PUT. Remove the File Print and see what the LOG shows for why I commented about unicode and inline formatting.
Then a Proc Print of a variable built.
data junk (keep=lngstr);
set namy (where= (name in ("Cylinders" "DriveTrain"))) end=lastone ;
length lngstr $5000 ;
retain lngstr;
lngstr = catx(",(*ESC*){newline}",strip(lngstr),
catx(' ', '{name=',quote(strip(name)), "label=", quote(strip("&abc")), '}'));
file print;
if lastone then do;
put lngstr;
call symputx('oks2',strip(lngstr));
output;
end;
run;
%put %bquote(&oks2.);
proc print data=junk noobs;
var lngstr;
run;
... View more