TABULATE OUTPUT DISPLAYS FOR ONCE ONLY? HOW TO EXPORT THE SAME 2 EXCEL IN ODS?

Accepted Solution Solved
Reply
Contributor
Posts: 51
Accepted Solution

TABULATE OUTPUT DISPLAYS FOR ONCE ONLY? HOW TO EXPORT THE SAME 2 EXCEL IN ODS?

At the end of a lengthy collection Macros and Procedures when I end the same with the following code:

PROC TABULATE DATA=RESULTS2 OUT=CHK2;

CLASS PRODUCT DPD_BUCKET DATA_MONTH;

VAR TOTAL_OS COUNT_OS;

TABLE PRODUCT, DPD_BUCKET, TOTAL_OS*DATA_MONTH;

RUN;

It presents an excellent Cross Tabulated Pivot Like format in OutPut Window. however, when I select and run only this last piece of code after clearing up the Output Window and Log with F12 the table never appears again:

ods tagsets.excelxp file="ExcelResultsA.xls";

proc PRINT data=RESULTS;

run; quit;

ods _all_ close;

Any particular reason?

Furthermore, how to export such an appearing table in the similar Pivot like manner in Excel via ODS?

Thanx in advance.


Accepted Solutions
Solution
‎09-18-2013 03:57 PM
Super User
Posts: 11,343

Re: TABULATE OUTPUT DISPLAYS FOR ONCE ONLY? HOW TO EXPORT THE SAME 2 EXCEL IN ODS?

Posted in reply to FarazA_Qureshi

Do you want the cross tab appearance, then run proc tabulate.

Proc print as shown is referencing the input to tabulate and print only knows rows, no nesting or crossing. You may have meant to try to print the output data set CHK2 but it would still not be the cross tab output.

you probably want

ods tagsets.excelxp file="ExcelResultsA.xls";

PROC TABULATE DATA=RESULTS2 OUT=CHK2;

CLASS PRODUCT DPD_BUCKET DATA_MONTH;

VAR TOTAL_OS COUNT_OS;

TABLE PRODUCT, DPD_BUCKET, TOTAL_OS*DATA_MONTH;

RUN;

ods tagsets.excelxp close; /* the _all_ close sometimes causes problems as no output destinations are open after runing the first time*/

View solution in original post


All Replies
Solution
‎09-18-2013 03:57 PM
Super User
Posts: 11,343

Re: TABULATE OUTPUT DISPLAYS FOR ONCE ONLY? HOW TO EXPORT THE SAME 2 EXCEL IN ODS?

Posted in reply to FarazA_Qureshi

Do you want the cross tab appearance, then run proc tabulate.

Proc print as shown is referencing the input to tabulate and print only knows rows, no nesting or crossing. You may have meant to try to print the output data set CHK2 but it would still not be the cross tab output.

you probably want

ods tagsets.excelxp file="ExcelResultsA.xls";

PROC TABULATE DATA=RESULTS2 OUT=CHK2;

CLASS PRODUCT DPD_BUCKET DATA_MONTH;

VAR TOTAL_OS COUNT_OS;

TABLE PRODUCT, DPD_BUCKET, TOTAL_OS*DATA_MONTH;

RUN;

ods tagsets.excelxp close; /* the _all_ close sometimes causes problems as no output destinations are open after runing the first time*/

Contributor
Posts: 51

Re: TABULATE OUTPUT DISPLAYS FOR ONCE ONLY? HOW TO EXPORT THE SAME 2 EXCEL IN ODS?

Thanx Ballard!
Sure do appreciate your explanation!

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 227 views
  • 0 likes
  • 2 in conversation