Hi, I think SQL will trim off the leading blanks by default, I don't know of a way to switch it off. However you can easily fool it: data tmp; cat="First level "; output; cat="_Second level"; output; cat="__Third level"; output; ; run; proc sql noprint; select distinct cat into :var_levels separated by "#" from tmp; quit; %put %sysfunc(tranwrd(&var_levels,_, )); Depends on what you want it for really. If I am doing rtf output then I would put the rtf code in the variable. Alternatively if you are creating a string from the 3 levels, then a retain, if last then output, should work. Or you could tranpose them etc.
... View more