- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
HI. I am trying to use a combination of PROC EXPORT and PROC REPORT.
I have 1 SAS dataset and I'd like to export that to Excel into multiple worksheets based on customer ID (one worksheet per customer). I also want to add the same title to each worksheet. Seems I cannot add titles using PROC EXPORT and I cannot figure out how to breakout my dataset into multiple worksheets using PROC REPORT.
Here is the code for exporting to multiple worksheets:
/*WORKS FOR EXPORTING WITH FORMAT AND 3 TITLE ROWS*/
%let rundate = %SYSFUNC(today(),yymmddn8.);
/* export report */
ods escapechar="~";
ods excel file="c:\users\my_name\documents\test..xlsx" options(sheet_name="Sheet1");
ods text="~{style[color=green fontstyle=italic] BANKRUPTCY CASE NO.";
ods text="~{style[color=green fontstyle=italic] FILED";
proc report data=work.SUMMARY/*(obs=5) */spanrows
style(report)={pretext=" "};
run;
ods excel close;
How can I combine the two? 1 SAS dataset exported to 1 Excel workbook with 1 worksheet per customer with a title.
Thanks.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Use BY statement and ODS EXCEL option
SHEET_INTERVAL='BYGROUP'
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content