ERROR: Library LI does not exist

Reply
Occasional Contributor
Posts: 17

ERROR: Library LI does not exist

Hey guys,

I'm trying to read my data set from my library, but there is a error: ERROR: Library LI does not exist. I don't understand why, can anyone help me here? Thanks.

My code:

libname Li "C:\Users\yl665\downloads\llcp2011_abridged";

proc contents data=Li.llcp2011_abridged; run;

proc print data=Li.llcp2011_abridged; run;

Capture.PNG

Contributor
Posts: 53

Re: ERROR: Library LI does not exist

Does the physical location exist? This error is pretty straightforward.

If you are trying to create the library with the execution of this code,that is not going to wrok. The library must already exist for the code to work.

Occasional Contributor
Posts: 17

Re: ERROR: Library LI does not exist

Yes, it is. I know, but I still couldn't figure it out.

Contributor
Posts: 53

Re: ERROR: Library LI does not exist

I can think of these -

1. Either there is some typo in the path.

2. The C:\Users\yl665\downloads\llcp2011_abridged is translating to something else (Something prefixed in front of CSmiley Happy

3. The C: is not your local drive and is disconnected, or you are trying to access some server's C: but SAS is looking in your local system and is unable to find the path.

Occasional Contributor
Posts: 17

Re: ERROR: Library LI does not exist

so the library could only be a folder??

Grand Advisor
Posts: 17,333

Re: ERROR: Library LI does not exist

No, a libname can reference an excel file or database but then you reference it differently.

Is llcp2011_abridged your sas data set?

Occasional Contributor
Posts: 17

Re: ERROR: Library LI does not exist

Yes, is it a data set.

llcp2011_abridged.sas7bdat

Contributor
Posts: 53

Re: ERROR: Library LI does not exist

In your case, you are trying to create a SAS dataset within a windows folder, correct?

A SAS dataset can be created within a directory and if this is windows, then yes you need to create a folder.

You can however reference databases and other sources using a libname statement. You can also export data to excel. But those I believe are not relevant to your particular case.

Unless I have misunderstood something about the problem.

Occasional Contributor
Posts: 17

Re: ERROR: Library LI does not exist

thank you so much

Grand Advisor
Posts: 17,333

Re: ERROR: Library LI does not exist

Then remove the dataset name from the libname statement and it should work for you.

libname Li "C:\Users\yl665\downloads";

proc contents data=Li.llcp2011_abridged; run;

proc print data=Li.llcp2011_abridged; run;

Occasional Contributor
Posts: 17

Re: ERROR: Library LI does not exist

Thank you so much.How did you learn the SAS?

Grand Advisor
Posts: 17,333

Re: ERROR: Library LI does not exist

SAS Training Guide - the first one is now available for free, see the SAS University Edition home page.

I had supervisors who felt I should learn it on my own though and didn't provide a ton of support but encouraged me to ask questions on SAS-L and to tech support.


I asked Tech Support a lot of stupid questions, they were nice though, but I got a few comments of "I've never seen someone do it quite like that before."

Contributor
Posts: 53

Re: ERROR: Library LI does not exist

Self-training and lot of on-the-job experience. Or if you have SAS editor, go online, get some case study and try to code the solution yourself. Also, see if you can get exposure in many platforms. Helps a lot.

Once you have the approach in my mind, just search on the SAS site, SAS has a macro, a function, a PROC, a format or informat for most things Smiley Happy Good luck.

Ask a Question
Discussion stats
  • 12 replies
  • 396 views
  • 2 likes
  • 3 in conversation