BookmarkSubscribeRSS Feed
Karlb
Calcite | Level 5

Hi

How can I easily read an open Excel-sheet out of the SAS-Program-window of the Excel-SAS Addin? Is there any Statement which I can use instead of "Active Excel Sheet" that works (see attached Screenshot). I know I could save the Excel-sheet, attach it with a library (libname XXX Excel "...") and then read it.

 

But is there any way to do it without saving the sheet (like the predefined statistic routines do it in the Addin).

 

Thnaks

Karl

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Not really, it would involve a fair bit of work to get the various plugins talking to each other and returning results.  Is importing the file too dificult?  If so its unlikely your going to find a simpler solution.  One thing I can suggest is that with (assumes you have SAS 9.4) libname excel and and xlsx file then you can set a libname to a file, thats a bit simpler, e.g.:

libname xl xlsx "<pathtoyourfile>/<yourfile>.xlsx";

data want;
  set xl.sheet1;
run;

libname xl clear;

The libname will show all the usable tabs in the workbook (if you goto library explorer you can actually see them).

Karlb
Calcite | Level 5

Thank you RW9  for your answere! 

No saving and importing is not really an issue.

Sincerly Karl

sas-innovate-2024.png

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.

 

Register now!

Discussion stats
  • 2 replies
  • 898 views
  • 0 likes
  • 2 in conversation