BookmarkSubscribeRSS Feed
nla2121
Calcite | Level 5

Hello, 

I am a new SAS user and having some issue when trying to import data. I get the error "Library is not assigned." My code and the error message is below. I read up on libraries, and I am not sure why I need one here for importing a single csv file, so some intuition into that would be much appreciated as well. I tried putting the libname inside and outside of the import procedure, it doesnt appear to be working either way.

 

Thanks!

6 REPLIES 6
Reeza
Super User

 

You're correct, you do not need  a library, but you've also indicated in your code that you'd like the data stored to a library so if you're trying to use one you do need to make sure it exists. 

 

When you use a naming convention such as libName.DataSetName this means the portion before the period is the libname. You've used this type of notation while trying to  name your output file so SAS is looking for that library to save the file. 

 

If you don't want that, remove the library name. 

 

Please post images directly into the forum using the photos icon, or better yet, post your code directly into the forum. 


@nla2121 wrote:

Hello, 

I am a new SAS user and having some issue when trying to import data. I get the error "Library is not assigned." My code and the error message is below. I read up on libraries, and I am not sure why I need one here for importing a single csv file, so some intuition into that would be much appreciated as well. I tried putting the libname inside and outside of the import procedure, it doesnt appear to be working either way.

 

Thanks!


 

 

VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

looks like you have a libname statement improperly placed in your SAS code.  Please post the code using the insert SAS code option

Jagadishkatam
Amethyst | Level 16

please use the libname P1 for storing the new dataset created from CSV file.

 

please call the libname P1 first and then in the proc import replace the ART. with P1.

Thanks,
Jag
Reeza
Super User

Libname statement also has to go before your PROC IMPORT, so it's ready before you try and use it.

 


@Jagadishkatam wrote:

please use the libname P1 for storing the new dataset created from CSV file.

 

please call the libname P1 first and then in the proc import replace the ART. with P1.


 Sorry, replied to wrong post.

nla2121
Calcite | Level 5

Hi everyone,

Thank you for the responses, they were instructive! Problem solved 🙂

 

Cheers!

Reeza
Super User

@nla2121 wrote:

Hi everyone,

Thank you for the responses, they were instructive! Problem solved 🙂

 

Cheers!


Please mark the question solved. 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 2491 views
  • 1 like
  • 4 in conversation