The SAS Output Delivery System and reporting techniques

Please help on formatting a number as 5.2 under proc print

Reply
N/A
Posts: 0

Please help on formatting a number as 5.2 under proc print

I'm using ods tagsets.excelxp. When I tried to output a variable with the format 5.2, I got 0.00.

Here is the logic:
proc print data=test;
var frate/style={tagattr='format:#0.00'};
run;

I've also tried
var frate/style={tagattr='format:Currency'};

just to see if that will work since I saw so many examples in published paper, but I got '$ - '.

I do have the latest ExcelXP, and the other options are all working fine. Any clue?

Thanks!
SAS Employee
Posts: 95

Re: Please help on formatting a number as 5.2 under proc print

Posted in reply to deleted_user
Is the value truly a number?
What is the sas format for that variable?

It looks like the type is wrong and your value is invalid.

You may need to add type:Number to your tagattr settings.
N/A
Posts: 0

Re: Please help on formatting a number as 5.2 under proc print

Yes, frate is a number (ratio indeed).

I changed the statement to:
var frate/style={tagattr='type:Number format:#0.00'};

There is no error message in my log but I could not even load the XML to Excel now.

Please advise, and thanks!!
SAS Employee
Posts: 95

Re: Please help on formatting a number as 5.2 under proc print

Posted in reply to deleted_user
In your original output, without the type, Can you find the
tags that are for that value?

I would like to know what the XML looks like, that the value would show up
as - or 0.00.

It doesn't make any sense. Also, if you could email me directly I will send
you a new tagset. I haven't had the chance to put it on the web yet so you
can't get it unless I send it to you. Eric.Gebhart@sas.com
Ask a Question
Discussion stats
  • 3 replies
  • 134 views
  • 0 likes
  • 2 in conversation