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

libname xl_lib xlsx "&outpath/storm.xlsx" ;

 

data xl_lib.storm_final;
set pg1.storm_final;
drop Lat Lon Basin OceanCode;
run;

*libname xl_lib clear;

Question: As per the demo in the course, this code should not generate any output data displayed in SAS studio as we are writing the same to excel workbook. clearing the libref at the end of the program is to remove reference to the library. why am I able to see output data if I don't clear libref and if I clear the libref, output data is not generated?

1 ACCEPTED SOLUTION

Accepted Solutions
palvani
Fluorite | Level 6
My question is how does clearing libref influences whether any data is visible in Output Data window in SAS studio?
I have commented the libname statement as part of testing so pl ignore that.
Results window is empty as we are not printing any data here.

View solution in original post

5 REPLIES 5
Reeza
Super User
What do you mean by "see output data"? No data will be written to the RESULTS window, but you will get a data set in your XL_LIB library.
Your second libname statement is commented out, so does not execute, which means your libref stays around.

If your libref is de-assigned/cleared the file still exists on your computer/in the folder but SAS won't have direct access via the libname.
palvani
Fluorite | Level 6
My question is how does clearing libref influences whether any data is visible in Output Data window in SAS studio?
I have commented the libname statement as part of testing so pl ignore that.
Results window is empty as we are not printing any data here.
Reeza
Super User
Clearing a libref means that you no longer see it under Libraries and it does not show up in the OUTPUT Data window either since the library is now un-assigned.


Reeza
Super User
This behavior will vary based on the SAS interface to some degree as well.
Base/Foundation has no output data tab in the first place.
EG does, but that could also be suppressed via other options.

For Studio, with default SAS settings, you're correct.
palvani
Fluorite | Level 6
Thanks Reeza. I think i get it. If I dnt clear the libref, SAS displays data from newly created dataset in Output Window.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

LIBNAME 101

Follow along as SAS technical trainer Dominique Weatherspoon expertly answers all your questions about SAS Libraries.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1124 views
  • 1 like
  • 2 in conversation