use proc tabulate with tagset excelXP

Reply
Occasional Contributor
Posts: 14

use proc tabulate with tagset excelXP

I am trying to use proc tabulate with excelXP to output my result to excel files. I leveraged one example online and want to test some of the functionalities I needed in my work. The attached SAS code is my modified example. Speficially, I changed the setting for 'CANADA' while keep the other two the same as original sample for comparison purpose. Here are the lists of my changes and corresponding questions:

1) I changed the format to comma10. However this didn't show up in the file like the original format dollar10. It did look fine in ods listing. In a seperate test I put

style=[tagattr = 'format:#,###']

after the variables in table statement. It did work however it change the yellow background for total back to no background color.

2) the title is set to a very long string on purpose. In the output file how can I make it displayed correctly? The cell is not long enough and it's not adjusted to the second row. option autofit_height seems not working with title.

3) if I want to add a last column specified as predict-actual, on top of the existing proc tabulate output, is it possible? I learned some examples with proc print, but don't know if proc tablulate could do this.

Thanks!

(testing environment PC SAS 9.2)

Attachment
Occasional Contributor
Posts: 14

Re: use proc tabulate with tagset excelXP

find the solution myself and post here. hopefully it's useful for others who have similiar issues.

1) proc tabulate can't work perfectly in this situation. use proc report and the style style=[tagattr = 'format:#,###'] works fine.

2) I find solution from the other thread about long title:

https://communities.sas.com/message/42755#42755

3) here again proc tabulate can't do this. use proc report and define a new column, similar to this:

define ratio / computed "ratio" style(column)={tagattr='format:0.00% Formula:RC[-1]/RC[-2]'};

compute ratio;

ratio=0;

endcomp;

Ask a Question
Discussion stats
  • 1 reply
  • 201 views
  • 0 likes
  • 1 in conversation