Help using Base SAS procedures

Why I cannot export this sas data file to Excel (ver 2003)

Accepted Solution Solved
Reply
Super Contributor
Posts: 338
Accepted Solution

Why I cannot export this sas data file to Excel (ver 2003)

Hi SAS Community,

I have used the SAS dataset named “vtemp” and generated the SAS dataset "a.Table_I_want_finally" using proc summary (Please see below code).

proc summary data=vtemp   nway missing;

format date date9.;

class date;

var Current One_to_30 Thirty_to_60 Sixty_to_90 Ninety_plus NPNA write_off;

output out=a.Table_I_want_finally(drop=_Smiley Happy

    sum=;

run;

proc print data= a.Table_I_want_finally;

run;

Now I want to export a.Table_I_want_finally to Excel (ver. 1993), and I used the following code.

PROC EXPORT DATA=a.Table_I_want_finally

OUTFILE="\\xxxxx-a9-sas01\kkm\data\ANYNAME.xls"

DBMS=EXCEL REPLACE;

PUTNAMES=YES;

run;

An error messege comes like this:
ERROR: DBMS type EXCEL not valid for export.


Then commented out dbms statement and ran.

Then this error message comes.
ERROR 180-322: Statement is not valid or it is used out of proper order.

Could any one help me to get over this problem?


From the literature, I found these:
DBMS= tells SAS what kind of file to create; the default is Excel 5. But what is the meaning of it?

PUTNAMES to output the variable name. If "PUTNAMES=NO" is used, the export procedure will not output any variable names, beginning with the data record instead.

But why then error message comes?

Thank you for the help

Mirisage


Accepted Solutions
Solution
‎08-30-2012 10:48 PM
Super User
Posts: 10,020

Re: Why I cannot export this sas data file to Excel (ver 2003)

Or if your excel file is in English, try to use XLS engine .

DBMS=XLS

View solution in original post


All Replies
PROC Star
Posts: 7,468

Re: Why I cannot export this sas data file to Excel (ver 2003)

Does your site license SAS/Access for PC File Formats?  If not, then you can't use the Excel engine.

Solution
‎08-30-2012 10:48 PM
Super User
Posts: 10,020

Re: Why I cannot export this sas data file to Excel (ver 2003)

Or if your excel file is in English, try to use XLS engine .

DBMS=XLS

Super Contributor
Posts: 338

Re: Why I cannot export this sas data file to Excel (ver 2003)

Hi Ksharp.

Great!.

It worked like anything!

Many thanks for your help.

Hi Art,

Thank you also for your input.

Warm regards

Mirisage

🔒 This topic is solved and locked.

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

Discussion stats
  • 3 replies
  • 447 views
  • 0 likes
  • 3 in conversation