BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
robulon
Quartz | Level 8

Hi all,

 

I'm a bit puzzled and hoping someone can shed some light on what's causing this issue. I was recently introduced by a colleague at work to the idea of writing data to an Excel sheet using a named range (already existing on the Excel book, but deleted using proc datasets then written again in a data step). I have done this successfully in EG as follows: -

 

%let xlpath=########/Arrears Level Charts.xlsx;


libname xl Excel "&xlpath";

 

proc datasets lib=xl nolist;
delete arrs_level.;
quit;

 

data xl.arrs_level.;
set arrs_level._trans_2;
run;


libname xl clear;

 

I have tried to use the same concept in SAS Studio but rather than the data being written to the named range on an existing tab, it is creating a new tab in the workbook with the named range name as the tab name, and creating the named range in that sheet. The only difference in the coding is that I have had to use the xlsx engine rather than the Excel one in my libname statement. Is anyone able to suggest why this might be happening, and what I would need to do to get the data written to the existing named range?

 

Thanks in advance for any suggestions.

 

Rob

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
The engines work differently. I've found PCFILES and Excel work, but not the newer one sadly.

Fortunately ODS EXCEL is coming along.

View solution in original post

2 REPLIES 2
Reeza
Super User
The engines work differently. I've found PCFILES and Excel work, but not the newer one sadly.

Fortunately ODS EXCEL is coming along.
robulon
Quartz | Level 8

Thanks Reeza,

 

It's no biggie as I've already got something in place that does what I need to do (I'm just proc exporting to a different tab, then using formulas to pull the data in to where I was hoping I could write the named range to).

 

I was just interested as to whether I was missing something fundamental.

 

Cheers,

Rob

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 851 views
  • 1 like
  • 2 in conversation