Desktop productivity for business analysts and programmers

Proc export error

Reply
Occasional Contributor
Posts: 6

Proc export error

Hi,

I'm trying to export data to an excel file without labeling it since I want the first row in the excel file to be the first row with data in the EG database.

I have EG 4.3 SAS9.2

proc export

data=work.QUERY_ART

DBMS=excelcs

outfile="C:\Documents\Reports SAS\Test.xls"

Replace;

PUTNAMES=NO;

Sheet="Test";

Server="pgl0408";

Port=8629;

Run;

However it gets an "ERROR 180-322: Statement is not valid or it is used out of proper order." for the putnames statement.

Appreciate all the help.

Trusted Advisor
Posts: 1,202

Re: Proc export error

Hi,

I think PUTNAMES=NO will not work with excel file. Try to export it as csv file.

Thanks

Grand Advisor
Posts: 17,311

Re: Proc export error

Why do you need no names?

When EG imports it strips the first row usually anyways.

Grand Advisor
Posts: 9,567

Re: Proc export error

Did you try ODS ?

ods tagsets.excelxp file='c:\temp\x.xls' ;
proc report data=sashelp.class noheader nowd;
run;
ods tagset.excelxp close;

Xia Keshan

Occasional Contributor
Posts: 6

Re: Proc export error

Hi,

I have tried with ODS as you mentioned:

ods tagsets.ExcelXP file='C:\Documents\Reports SAS\test1.XLS';

Proc Report data=work.query_art_vta_compl noheader nowd;

run;

ods tagsets.ExcelXP close;

and it turns out the following error:

ERROR: Physical file does not exist, C:\Documents\Reports SAS\test1.XLS.

And it did produces any file.

Grand Advisor
Posts: 10,196

Re: Proc export error

Are running this on a server or locally. The server may not have a path available of C:\Documents\Reports SAS.

Trusted Advisor
Posts: 1,202

Re: Proc export error

Hi,

Use this for the desired output.

Thanks,

Naeem

proc export

data=work.QUERY_ART

DBMS=csv

outfile="C:\Documents\Reports SAS\Test.csv"

Replace;

PUTNAMES=NO;

Run;

Ask a Question
Discussion stats
  • 6 replies
  • 1805 views
  • 0 likes
  • 5 in conversation