Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Comma in ODS ExcelXP output

Status
Not open for further replies.

khfor2007

IS-IT--Management
Mar 13, 2007
9
0
0
US
Hi everyone,

I am using ODS ExcelXP on Mainframe to send a proc print output to Excel, however the format in the ODS output does not seem to agree with the format comma10. I specified in the proc print

For example:

Proc print data=test;
var Price;
format Price comma10. ;
run;

My SAS output:
Price
3,000,000
But my ODS output would have no comma:
Price
3000000

I used the TAGATTR in style option as follows (but still DOES NOT WORK)

ODS TAGSETS.EXCELXP Options(sheetname='xxxx');
proc print data=test label noobs;
var price/ style(data)={tagattr="format:comma10."};
run;
ODS _all_ close;

I would really appreciate it if someone could help me on this.

Thanks.

K


 
Hi Khfor2007,

Try using the "Thousands_separator" option of the EXCEL XP Tagset. It would apply the separator specified after every thousand-th value for Numeric values.

Your code should look similar to this:

Code:
ODS TAGSETS.EXCELXP
    Options(sheetname='xxxx'
            Thousands_separator=',');
    proc print data=test label noobs;
         var price;
    run;
ODS _all_ close;

Hope this helps!

Sarav
 
Thanks Sarav for your help!

But it still does not work with the THOUSANDS_SEPARATOR. However, I used TAGATTR like this:

ODS TAGSET.EXCELXP options(....);
Proc print data=test;
var price / style={tagattr='format:#,##0'} ;
run;
ODS _all_ CLOSE;


And IT WORKS !!! thanks,



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top