By running the following statemant to export the results of a "proc tabulate" to EXCEL, SAS did a perfect job, except that I miss the the class variable (ir_Nr_GTAP) at the top of each tables (see above):
ods xml file="G:\GTAP\SAS_OUTPUT_XLS\DK_NAMA_EU_BT.csv" type=csvall;
PROC tabulate DATA = DK.SZ_EU_SG_IrG_ErG;
CLASS sct_Nr_GTAP ir_Nr_GTAP er_Nr_GTAP;
TABLE ir_Nr_GTAP, sct_Nr_GTAP, er_Nr_GTAP *(BT__ * mean * F=10.6 )
/ PRINTMISS RTS = 14;
ods xml close;
All the tables look like this, without reporting the ir_Nr_GTAP variable at teh top of each table:
If, however, you WANT to get a CSV file, then you -can- get your page dimension into the CSV file as long as you do this:
1) Keep using the CSVALL tagset -- I prefer using the ODS MARKUP statement directly or ODS CSVALL instead of the ODS XML statement for this.
ODS CSVALL ...; ODS MARKUP TAGSET=CSVALL ...;
ODS CSVALL CLOSE; ODS MARKUP CLOSE;
(depending on your version of SAS -- I believe that CSVALL was not an invocable alias until SAS 8.2)
2) Use box=_page_ on your TABLE Statement to force the text INSIDE the Tabulate table area. You may get a message in LISTING that the page text is too long. This will NOT bother HTML or CSVALL, so you can ignore this NOTE.
CSVALL was actually available in SAS 8.2. But ExcelXP is definitely SAS 9. I am surprised that the ODS XML syntax worked for you in SAS 8.01 -- but perhaps it was there in a rudimentary form. Honestly, I don't remember.
An older, somewhat different method of creating CSV and HTML files did exist. You may not have heard about them. They were called the "HTML Formatting Tools Macros" -- they included ways to get tabulate output into HTML (which you can open with Excel) or SAS datasets into CSV form (which you can also open with Excel).
We used to teach these macros in SAS 6, so they may be out there in your installation. The 2 macros of interest to you might be: %tab2htm (sends proc tabulate to a minimal HTML file, which opens in Excel 97 and higher) and %ds2csv (sends a SAS dataset to CSV, which opens in Excel)
But, here's a quick example you can try. (When you go to use the page dimension, I think you will still have to use box=_page_.) At any rate, it's not a CSV file, if you use %tab2htm, but it is pretty sparse in terms of HTML. So it may be smaller in size that what you're currently creating. After you run these macros you will NOT see anything in the SAS Results Window -- you have to use Windows Explorer or IE or Excel or Notepad to navigate to the files and open them.
**** the code;