BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
PaigeMiller
Diamond | Level 26

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?

--
Paige Miller
1 ACCEPTED SOLUTION
8 REPLIES 8
PaigeMiller
Diamond | Level 26

Well that was way too easy! Thanks!

--
Paige Miller
art297
Opal | Level 21

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

Cynthia_sas
SAS Super FREQ

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;

Ksharp
Super User

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

putnames=no;

run;

PaigeMiller
Diamond | Level 26

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?

--
Paige Miller
Ksharp
Super User

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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