BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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
6 REPLIES 6
jc671
Calcite | Level 5
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
Ksharp
Super User
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
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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
Ksharp
Super User
Thx. I am using older SAS.
Peter_C
Rhodochrosite | Level 12
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
Ksharp
Super User
Thank u. I will check it out.

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 1043 views
  • 0 likes
  • 5 in conversation