while working encountered error message ERROR: Libname <dataset>is not assigned.please help to understand and remedy
7 proc print data=in2.prac;
ERROR: Libname IN2 is not assigned.
8 run;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds
@maddyjoshi29 wrote:
while working encountered error message ERROR: Libname <dataset>is not assigned.please help to understand and remedy
7 proc print data=in2.prac; < this line says the data set to print named PRAC is in the library named IN2.
ERROR: Libname IN2 is not assigned.
8 run;NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds
If the library has not been assigned for the current session then SAS cannot find the data. A libname statement similar to:
LIBNAME IN2 "C:\path\foldername";
is one way to provide a library. If you use the menu (such as Tools>New Library) to create a library you may need to indicate "make it permanent" by checking a box to make the system automatically assign the the library the next time SAS starts. The exact approach varies between Base SAS, Enterprise Guide, SAS Studio and University Edition (varies a LOT for UE).
Screen shots didn't attach apparently.
Which LIBRARY did you tell the import to go to? The default would likely have been WORK. If you didn't assign a library you might look in the SAS Explorer window for a library with an odd name and look there for the data file. If so, change the proc print to use that library name instead of IN2.
@maddyjoshi29 wrote:
I have already created a library (by the name of Recorded) and saved my imported excel file by the name of IN2.
And when I write -
Proc Print data=In2.recorded;
run;
it doesn't run and gives that error in log.
The reference is always library.dataset, not dataset.library.
Us
proc print data=recorded.in2;
I doubt you're using SAS 9.0, can you confirm with the following code, check your log for the output:
%put &sysver;
Navigate to your library/folders window on the left hand side. Do you see a library called IN2? If not, you can create it using the code previously suggested.
If this is a library that you expect to be pre-assigned, ie assigned when you start up, it could be either a temporary network glitch when you started SAS didn't allow for the library to be assigned or something changed.
Hi:
The LIBRARY is a nickname for a physical path location on your operating system or server. For example, these all define the ORION library:
Windows: libname orion 'c:\temp\classes\pg1';
Unix: libname orion '/unx/classes/pg1';
Mainframe: libname orion 'SASCZZ.DATA.CLASSES.PG1' DISP=SHR;
SAS on Demand server: libname orion '/home/cynther0/pg1';
SAS University Edition: libname orion '/folders/myfolders/ecprg193';
Once you have the library defined, then you can run PROC CONTENTS to see the names of the datasets stored in the library:
proc contents data=orion._all_;
title 'what are the datasets';
run;
Then, you refer to the datasets by their 2 level name. So, let's take Windows as an example. If I have
Physical file name, as stored on disk: c:\temp\classes\pg1\customers.sas7bdat
LIBNAME statement: libname orion 'c:\temp\classes\pg1';
Then to print the rows, I would use this code:
proc print data=orion.customers;
title 'Orion.Customers';
run;
As you can see, ORION (the name of the library) is the first part of the 2-level name and CUSTOMERS (the file name of the physical file) is the second part of the 2-level name.
This is how the LIBNAME works, no matter what version of SAS you are using.
cynthia
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.