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

How to resolve Libref is not assigned , Library name is not assigned  error in proc import command

 

***** This is not A spam , I have real question  !!!!***

 

Java Version: 1.8.0_181

SAS release: 9.04.01M6P11072018

SAS platform: Linux LIN X64 2.6.32-754.6.3.el6.x86_64

Site name: UNIVERSITY EDITION 2.8 9.4 M6

 

I am using SAS on VMware ( SAS on virtual Machine) , I have the same issue when I use SAS onDemand.

 

I followed the guide line in setting up SAS on VMware using the below link

http://support.sas.com/software/products/university-edition/docs/en/SASUniversityEditionInstallGuide...

I configured the shared folder  option 

 

I have no issue in working with datalines but when I try to import data using proc import ,

( data which is already stored in the working directory.)

 

Here is the code I used

 

proc import datafile='/folders/myfolders/Logging.csv'

DBMS=csv out=Logging.csv replace;

run;

proc print data=Logging.csv;

run;

Here is the three errors I am getting , though I was able to solve the first one.

 

first error: Libref 'LoggingData' exceeds 8 characters  , I resolved the issue by renaming my file name under 8 characters to Logging

Second error : Library name is not assigned  

Third error : Libref LOGGING (mydataname) is not assigned

 

Effort :

I spent literally 6 hours looking for answer from YouTube to SAS blogs and SAS community support ,

I came across very similar stuff , but nothing seems clear and concise

I tried to use the below command ( custom library  as the WORK lib doesnt seem to work)  for every proc command but it is not working either

 

%let dirdata=C:\SASUniverstyEdition\myfolders;

libname SASLIBS "&dirdata";

run;

 

libname SASLIBS '/folders/myfolders/sasuser.v94';

options user=SASLIBS;

run;

 

I also tried to edit the autoexec.sas code

 

my question is

 

how can I get past these two annoying errors

why would I need to assign library if SAS already has a default one , WORK

How can I assign my library globally never to be asked again

 

Please show with examples , as most of help threads are  not straight forward

I really need help , I have a lot to work on my project but I am stuck in reading the data.Thanks in advance. 

1 ACCEPTED SOLUTION

Accepted Solutions
BrianGaines
SAS Employee

@brook2,

 

Try changing your code to this and running it:

 

proc import datafile='/folders/myfolders/Logging.csv'
   DBMS=csv out=Logging replace;
run;

proc print data=Logging;
run;

I modified your code by changing "Logging.csv" to "Logging" in the OUT= option of PROC IMPORT and the DATA= option of PROC PRINT. 

 

SAS uses a two-level name to refer to a data set (libref.datasetName), and Work is used if only a one-level name specified.  So when you refer to it as "Logging.csv" SAS then looks for a data set named Csv in the Logging library.  If you instead use "Logging" then the "Logging" data set will be created in the default Work library.  

 

Does this make sense?

View solution in original post

6 REPLIES 6
BrianGaines
SAS Employee

@brook2,

 

Try changing your code to this and running it:

 

proc import datafile='/folders/myfolders/Logging.csv'
   DBMS=csv out=Logging replace;
run;

proc print data=Logging;
run;

I modified your code by changing "Logging.csv" to "Logging" in the OUT= option of PROC IMPORT and the DATA= option of PROC PRINT. 

 

SAS uses a two-level name to refer to a data set (libref.datasetName), and Work is used if only a one-level name specified.  So when you refer to it as "Logging.csv" SAS then looks for a data set named Csv in the Logging library.  If you instead use "Logging" then the "Logging" data set will be created in the default Work library.  

 

Does this make sense?

brook2
Fluorite | Level 6

Thank you so much !!! I spent hours for this silly mistake .Thank you again !!

yemu10
Calcite | Level 5

I am having this error:

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 libname in xport '/home/u58437933/CBC_J.XPT';
NOTE: Libref IN was successfully assigned as follows:
Engine: XPORT
Physical Name: /home/u58437933/CBC_J.XPT
74 libname out xlsx '/home/u58437933/out2.xls';
ERROR: Invalid physical name for library OUT.
ERROR: Error in the LIBNAME statement.
75 proc copy inlib=in outlib=out;
76 run;
 
ERROR: Libref OUT is not assigned. 
 
with this code
libname in xport '/home/u5843/CBC_J.XPT';
libname out xlsx '/home/u5843/out2.xls';
proc copy inlib=in outlib=out;
run;
Thuong
Fluorite | Level 6

Hi there, 

 

I abit wonder how I can get the user information u58437933?

 

Thanks

VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

 

proc import datafile='/folders/myfolders/Logging.csv'
DBMS=csv out=Logging replace;
run;
proc print data=Logging;
run;

 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 6 replies
  • 29948 views
  • 2 likes
  • 5 in conversation