BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
juliajulia
Obsidian | Level 7

hello, 

I use the sas ods to export two tables but the two table are exported to two different tabs. how can i export to excel file with only one tab that include both data result: my original code like this:


ods excel file = "D:\RSR\output\test.xlsx";
proc report data=table01aage;
title j=l "Table 1a. ";

column agegroup _016No _016colper _017No _017colper
_018No _018colper
_019No _019colper
_020No _020Colper
_021No _021Col_Per;
define agegroup / display 'Age group (yr)' style={just=left};
define _016No / display 'No' ;
define _016colper / display "%" format=comma12.2;
define _017No / display 'No';
define _017colper / display "%" format=comma12.2;
define _018No / display 'No';
define _018colper / display "%" format=comma12.2;
define _019No / display 'No';
define _019colper / display "%" format=comma12.2;
define _020No / display 'No';
define _020colper / display "%" format=comma12.2;
define _021No / display 'No';
define _021col_per / display "%" format=comma12.2;
run;

proc report data=table01agender;

column F1 No_ Col_Percent No_1 Col_Percent1 No_2 Col_Percent2 No_3 Col_Percent3 No_4 Col_Percent4 No_5 Col_Percent5 ;
define F1 / display 'Gender' style={just=left};
define No_ / display 'No' ;
define Col_Percent / display "%" format=comma12.2;
define No_1 / display 'No';
define Col_Percent1 / display "%" format=comma12.2;
define No_2 / display 'No';
define Col_Percent2 / display "%" format=comma12.2;
define No_3 / display 'No';
define Col_Percent3 / display "%" format=comma12.2;
define No_4 / display 'No';
define Col_Percent4 / display "%" format=comma12.2;
define No_5 / display 'No';
define Col_Percent5 / display "%" format=comma12.2;
run;

ods excel close;

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26
ods excel file = "D:\RSR\output\test.xlsx" options(sheet_interval='NONE');
--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26
ods excel file = "D:\RSR\output\test.xlsx" options(sheet_interval='NONE');
--
Paige Miller
juliajulia
Obsidian | Level 7
This works well. Thank you!

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

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