As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.


Here are some tips for How to share your SAS knowledge with your professional network.


Tips:Strip Blanks from PROC SQL-Created Macro Variable Values

From sasCommunity
Revision as of 12:31, 30 September 2011 by Donh (Talk | contribs)

Jump to: navigation, search

A macro variable created in PROC SQL from a numeric variable or function has leading blanks ...

proc sql;
select count(*) into :howmany
from sashelp.class;
quit;
%put |&howmany|;
 
|      19|

An easy way to get rid of the leading blanks is as follows ...

proc sql;
select count(*) into :howmany separated by ''
from sashelp.class;
quit;
%put |&howmany|;
 
|19|

Posted with thanks to Robert Allison.

....see also

Submitted By Mike Zdeb