All I seem to be able to get is the raw numbers. I'm trying to get the sum to show up like currency with Dollars and commas (at least commas) and the pctsum to show up like a percent.
I can get the commas with tagattr or I can get the percent without tagattr, but I can't find a way to get both. Any help?
ods listing;title;
options missing = '';
ods tagsets.excelxp
file= "c:\junk.xls"
style=normal
options (SHEET_INTERVAL="NONE");
ods tagsets.excelxp options (Sheet_Name = "Portfolio");
proc tabulate data=delq1 missing;
class portfolio monthend delq;
var totalbalance;
tables (portfolio='' all='')*(
totalbalance = "Balance" *sum='' *f=comma24.0
totalbalance = "Rate" *colpctsum='' *f=percent24.2
),(delq='' all) ,(monthend='')
/
box = '' row=float; format delq delq.;
run;
ODS TAGSETS.EXCELXP CLOSE;
Got it already. Posting for future searchers. Trick was specifying style..
ods tagsets.excelxp file='c:\temp\junk.xml'
style=sasweb
options (SHEET_INTERVAL="NONE"
absolute_column_width = '14,11,6,6,6,6,6,6,6,6,6,6,6,6,6'
embedded_titles='yes'
TAGATTR="format:excel-format"
fittopage='yes'
orientation='Landscape');
proc tabulate data=delq1 missing;
class portfolio monthend cycledelinquency;
var totalbalance ;
tables (portfolio='' all='')*(
totalbalance = "Balance" *sum='' *f=comma24.0 *{style={tagattr="format:###,###,###"}}
totalbalance = "Rate" *colpctsum='' *f=pct.
),(cycledelinquency='' all) ,(monthend='')
/
box = '' row=float; format cycledelinquency delq.;
run;
ods _all_ close;
Got it already. Posting for future searchers. Trick was specifying style..
ods tagsets.excelxp file='c:\temp\junk.xml'
style=sasweb
options (SHEET_INTERVAL="NONE"
absolute_column_width = '14,11,6,6,6,6,6,6,6,6,6,6,6,6,6'
embedded_titles='yes'
TAGATTR="format:excel-format"
fittopage='yes'
orientation='Landscape');
proc tabulate data=delq1 missing;
class portfolio monthend cycledelinquency;
var totalbalance ;
tables (portfolio='' all='')*(
totalbalance = "Balance" *sum='' *f=comma24.0 *{style={tagattr="format:###,###,###"}}
totalbalance = "Rate" *colpctsum='' *f=pct.
),(cycledelinquency='' all) ,(monthend='')
/
box = '' row=float; format cycledelinquency delq.;
run;
ods _all_ close;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.