The SAS Output Delivery System and reporting techniques

ODS Tagset to Excel: Commas for Thousands and % for Percents

Accepted Solution Solved
Reply
Contributor
Posts: 61
Accepted Solution

ODS Tagset to Excel: Commas for Thousands and % for Percents

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;


Accepted Solutions
Solution
‎03-16-2012 01:55 PM
Contributor
Posts: 61

ODS Tagset to Excel: Commas for Thousands and % for Percents

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;

View solution in original post


All Replies
Solution
‎03-16-2012 01:55 PM
Contributor
Posts: 61

ODS Tagset to Excel: Commas for Thousands and % for Percents

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;

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 1995 views
  • 0 likes
  • 1 in conversation