DATA Step, Macro, Functions and more

Writing SAS data into MS Excel without varnames

Reply
N/A
Posts: 0

Writing SAS data into MS Excel without varnames

Hi,
I am trying to use the LIBNAME statement to read and write the data from/into the excel file. To access I use also the named ranges as mentioned in http://www2.sas.com/proceedings/sugi31/024-31.pdf

I have the the following question:
is there any possibility to write the SAS data into MS Excel named range without writing the variable names? (I have found the libname option HEADER=NO that for reading without varnames, but this doesn't work when writing into excel).

My SAS version is 9.1.3.

Thank you in advance!
Jaroslav
New Contributor
Posts: 2

Re: Writing SAS data into MS Excel without varnames

Posted in reply to deleted_user
Any luck finding the answer to this question? I tried using options HEADER=NO and dbSasLabel=none but they did not work.

Thank You,
JC
Super User
Posts: 10,046

Re: Writing SAS data into MS Excel without varnames

There are some suggestion from Cynthia@sas .

[pre]
data _null_;
set sashelp.class;
file 'c:\range.csv' dsd;
put name sex;
run;
[/pre]

then open range.csv by excel and Save As ----> xls file.


Ksharp
Super Contributor
Super Contributor
Posts: 3,174

Re: Writing SAS data into MS Excel without varnames

Starting with SAS 9.2, ODS CSV can optionally suppress a column header row. Check the options DOC.

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search argument, this topic/post:

+"ods csv" +options +doc site:sas.com
Super User
Posts: 10,046

Re: Writing SAS data into MS Excel without varnames

Thx. I am using older SAS.
Valued Guide
Posts: 2,177

Re: Writing SAS data into MS Excel without varnames

Jaroslav
Which version do you use?

If you want to write into an existing range name (in an existing excel workbook), you have very few methods where the range does not have a header row.
It is possible that the only way will be the (much-deprecated) DDE which has worked in all releases of SAS on windows since SAS version 6.08. It needs to be able to write into an open instance of excel.
Which versions of excel and sas do you use?

peter
Super User
Posts: 10,046

Re: Writing SAS data into MS Excel without varnames

Thank u. I will check it out.
Ask a Question
Discussion stats
  • 6 replies
  • 223 views
  • 0 likes
  • 5 in conversation