BookmarkSubscribeRSS Feed
maddyjoshi29
Calcite | Level 5

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

 

9 REPLIES 9
ballardw
Super User

@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).

maddyjoshi29
Calcite | Level 5
I am using SAS version 9.0. I cant see option for new library in tools.... what I am trying to do is , though I have been doing this from quite some time and successfully done it before but now getting error.

I go to file > import data( saved in 97,2003 format in excel in drive and save in as folder in one of my library... I have attached the screenshot of steps for your reference.
ballardw
Super User

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
Calcite | Level 5
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.
ballardw
Super User

@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;

maddyjoshi29
Calcite | Level 5
oh my god... I didnt even notice this mistake.. thank you so much ballardw :):).. appreciate your effort.. thanks a
ton
Reeza
Super User

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.

 

 

maddyjoshi29
Calcite | Level 5
hello Reeza,

I will check that though but I'm sure using ver-9.0
I had been able to create library and run the code previously... nevertheless will check again and keep posted.
Cynthia_sas
SAS Super FREQ

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

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!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 9 replies
  • 2967 views
  • 0 likes
  • 4 in conversation