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.
Hi,
I think PUTNAMES=NO will not work with excel file. Try to export it as csv file.
Thanks
Why do you need no names?
When EG imports it strips the first row usually anyways.
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
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.
Are running this on a server or locally. The server may not have a path available of C:\Documents\Reports SAS.
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;
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.
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.