DATA Step, Macro, Functions and more

Creating XLS file with no SAS variable name in Row 1

Accepted Solution Solved
Reply
Trusted Advisor
Posts: 1,909
Accepted Solution

Creating XLS file with no SAS variable name in Row 1

I want to take a SAS data set and create an XLS or XLSX file where the first row is not the SAS variable names. In other words, I want row 1 in Excel to be the first row of data in the SAS data set.

I do not want an XML file.

How can I do this?


Accepted Solutions
Solution
‎12-18-2014 03:00 PM
PROC Star
Posts: 7,467

Re: Creating XLS file with no SAS variable name in Row 1

Posted in reply to PaigeMiller

All Replies
Solution
‎12-18-2014 03:00 PM
PROC Star
Posts: 7,467

Re: Creating XLS file with no SAS variable name in Row 1

Posted in reply to PaigeMiller
Trusted Advisor
Posts: 1,909

Re: Creating XLS file with no SAS variable name in Row 1

Well that was way too easy! Thanks!

PROC Star
Posts: 7,467

Re: Creating XLS file with no SAS variable name in Row 1

Posted in reply to PaigeMiller

I'll be sure to make it more difficult next time!

SAS Super FREQ
Posts: 8,862

Re: Creating XLS file with no SAS variable name in Row 1

Proc Report needs a boost. Here's the PROC REPORT/NOHEADER method.

Cynthia

ods csv file='c:\temp\noheader.csv';

proc report data=sashelp.class nowd noheader;

run;

ods csv close;

Super User
Posts: 10,018

Re: Creating XLS file with no SAS variable name in Row 1

Posted in reply to PaigeMiller

proc export data=sashelp.class outfile='c:\temp\class.xls' dbms=xls replace;

putnames=no;

run;

Trusted Advisor
Posts: 1,909

Re: Creating XLS file with no SAS variable name in Row 1

Okay , that's a great answer.

When I tried this before posting the original question, I used dbms=excel, and I got an error. Obviously, dbms=xls works.

Can anyone explain the difference?

PROC Star
Posts: 7,467

Re: Creating XLS file with no SAS variable name in Row 1

Posted in reply to PaigeMiller
Super User
Posts: 10,018

Re: Creating XLS file with no SAS variable name in Row 1

Posted in reply to PaigeMiller

Yes. They are different engine. Excel engine can handle both ascii( english character) - single byte  stored and DBMS - double byte  stored ( like Chinese Korea Japanese) . but XLS only can handle  single byte  stored character( english ) . since you are from U.S , that doesn't matter if using excel or xls . But for me from China , only can use Excel engine.

Xia Keshan

🔒 This topic is solved and locked.

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

Discussion stats
  • 8 replies
  • 289 views
  • 3 likes
  • 4 in conversation