BookmarkSubscribeRSS Feed
PJorge
Calcite | Level 5

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.

6 REPLIES 6
stat_sas
Ammonite | Level 13

Hi,

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

Thanks

Reeza
Super User

Why do you need no names?

When EG imports it strips the first row usually anyways.

Ksharp
Super User

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

PJorge
Calcite | Level 5

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.

ballardw
Super User

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

stat_sas
Ammonite | Level 13

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;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 6 replies
  • 3838 views
  • 0 likes
  • 5 in conversation