For example, if i run the code below, the default 'output data' is a temporary file (library temp0, not work), not the permanent file. Since I have only referenced the cert library, why is it outputting to this extra library and what is it? To be clear, the cert library file is also available in the output -- the output has two files, but the right one is not the default. I tried print without referencing the data set and I get the same output.
DATa cert.penngolf ;
set '/home/u49936438/sasuser.v94/penngolf.sas7bdat';
Bogey = 0.186*Slope + USGA ;
label Bogey = 'Bogey Rating'
USGA = 'USGA Rating'
Slope = 'Course Slope'
Par = 'Course Par'
Yards = 'Total Yardage';
format Bogey 4.1 Yards comma5.;
RUN;
PROC PRINT data = cert.penngolf NOOBS ;
title 'The penngolf data set';
var Name Yards Par Slope USGA Bogey;
RUN;
You may have made that earlier, typically _temp libraries come from opening a data set by clicking on a file outside of SAS and the system associations create the library so SAS can display the data or referencing the set with a literal path as you did instead of library.dataset syntax. Data sets must be a library so one was created. Depending on where that file was it may also be in a defined library. More than one library can point to the same physical storage location. Which means that a data set in the library could be accesses using any of the library names. So if your CERT library happens to be the same as _temp0 physically then CERT.Penngolf is the same data set as _temp0.Penngolf and the only reason you think they are different some how is a minor misunderstanding of how Libraries work.
Go to your LIBRARIES in the menu. Open _TEMP0 and look at the data set. Then open Cert and look. Do the datasets look the same? Number and names and properties.
You may also want to try sending the output to a different data set if the _TEMP0 and CERT libraries are the same physical location because the data step completely replaced the original version of the data set.
That's not your output data set that's the one sitting in SASUSERV9.4. Since you didn't assign it a library and are opening it directly, probably double clicking, SAS creates a temporary libname to reference it. EDIT: Or Studio is doing that because you referenced it directly via the path, not via a library. If you do it via a library that shouldn't appear.
Like I mentioned, if you give your data sets unique names this becomes easier to see.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.