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

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=_:)

    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

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

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

DBMS=XLS

View solution in original post

3 REPLIES 3
art297
Opal | Level 21

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

Ksharp
Super User

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

DBMS=XLS

Mirisage
Obsidian | Level 7

Hi Ksharp.

Great!.

It worked like anything!

Many thanks for your help.

Hi Art,

Thank you also for your input.

Warm regards

Mirisage

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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