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;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.