Help using Base SAS procedures

proc tabulate justification in excel

Reply
N/A
Posts: 0

proc tabulate justification in excel

I'm using proc tabulate and outputting to excel through ODS html. I can't get any of the justification options in the style= command to work. Any suggestions? thanks.
SAS Super FREQ
Posts: 8,743

Re: proc tabulate justification in excel

Hi:
Excel is very picky about how you specify style attributes in an HTML file. In fact, Excel is "happier" rendering HTML 3.2 tags, or Microsoft-specific HTML tags than it is rendering HTML 4.0 tags.
One thing you can try is to use a different method of creating your HTML and see whether the justification is handled differently:
[pre]
ods html3 file='ht3.html' style=sasweb;
ods msoffice2k file='mso.html' style=sasweb;
...your SAS code ...
ods _all_ close;
[/pre]

You can try either of these methods of creating HTML files and see if Excel accepts the justification attributes better.

Otherwise, you have a few other choices:
1) create a Spreadsheet Markup Language XML file using ODS TAGSETS.EXCELXP and see if the justification attributes are honored:
ods tagsets.excelxp file='xpfile.xls' style=sasweb;
...your SAS code ...
ods _all_ close;

[/pre]


2) With any of the HTML methods, investigate using the HTMLSTYLE attribute in a STYLE= override (for PRINT, REPORT or TABULATE) to see whether you can specify a justification attribute that will be respected by Excel)

3) With the XML-based ExcelXP method, investigate using the TAGATTR attribute in a STYLE= override to see whether you can specify a justification attribute that will be respected by Excel.)

Just remember that one of the areas of difference between Microsoft and the W3C, in respect to style attributes and CSS style specifications for HTML was in the area of text alignment and how and where that style attribute should be specified.

You may wish to work with Tech Support on this question, as they can look at your code and look at your data and advise you about the best approach.

cynthia
Ask a Question
Discussion stats
  • 1 reply
  • 118 views
  • 0 likes
  • 2 in conversation