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
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.
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?
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?
Thank you so much !!! I spent hours for this silly mistake .Thank you again !!
You're welcome, I'm glad to help!
I am having this error:
Hi there,
I abit wonder how I can get the user information u58437933?
Thanks
proc import datafile='/folders/myfolders/Logging.csv'
DBMS=csv out=Logging replace;
run;
proc print data=Logging;
run;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.