Help using Base SAS procedures

Proc Export to Excel: Extra Sheets?

Reply
N/A
Posts: 0

Proc Export to Excel: Extra Sheets?

I'm using Proc Export to copy two datasets to an Excel (xlsx) spreadsheet (code below). Everything works ok except that I get three extra blank sheets (named sheet1, sheet2 and sheet3) before my two output sheets (Micro and Chem). Can anyone tell me what's going on? Thanks!

Jeff


PROC EXPORT
DATA=qc.micro_sorted
OUTFILE= "&req_dir\R110185 Listing.xlsx"
DBMS=EXCEL
REPLACE;
SHEET="Micro";
RUN;

PROC EXPORT
DATA=qc.chem_sorted
OUTFILE= "&req_dir\R110185 Listing.xlsx"
DBMS=EXCEL
REPLACE;
SHEET="Chem";
RUN;


Additionally, I figured out that I only get the extra sheets when the spreadsheet already exists but don't get them if this is run without the spreadsheet already existing. Message was edited by: JCS
Contributor
Posts: 33

Re: Proc Export to Excel: Extra Sheets?

Posted in reply to deleted_user
We don't have the ability to export directly to Excel, so I don't know about this, but I do know that Excel will often open a new workbook with multiple sheets - default tends to be three unless you change that.

When you say you only get the sheets when spreadsheet already exists, does that mean when you originally create the spreadsheet via SAS, you don't get it, but then you Replace into it, it adds three blank sheets? Or do you mean you've created an workbook via Excel and then export into it?
Ask a Question
Discussion stats
  • 1 reply
  • 2486 views
  • 0 likes
  • 2 in conversation