Desktop productivity for business analysts and programmers

ERROR: Library LEARN does not exist.

Reply
New Contributor
Posts: 3

ERROR: Library LEARN does not exist.

Hi

I'm trying to create a library in SAS Enterprise Guide OnDemand for Academics.  I get the following error when I run the program. Can anyone help me figure out why?

I'm trying to run a Create_Datasets program that came with the book "Learning SAS® by Example: A Programmer’s Guide"

libname learn '\\vmware-host\Shared Folders\Desktop\learn';

Esteemed Advisor
Posts: 6,634

Re: ERROR: Library LEARN does not exist.

AFAIK, the SAS on demand works with a remote server process in a cloud, so you can only defiine a library with a pathname that resides in the cloud. A local path on your desktop will not work.

Learning SAS by Example was not written with SAS on Demand in mind.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
New Contributor
Posts: 3

Re: ERROR: Library LEARN does not exist.

Hmm which for of SAS is best for that book?

In the book they suggest that we use SAS Enterprise Guide 4.1.

Esteemed Advisor
Posts: 6,634

Re: ERROR: Library LEARN does not exist.

Since the latest EG is now at level 7.1 or so, you can imagine how old that book is, it predates SAS UE and SAS on Demand by something like a decade. Usually these books assume that you have SAS and the EG installed locally on your Windows box.

Our installation is already dated, with SAS 9.2 and EG 4.3.

Have a look at https://support.sas.com/training/tutorial/

Maybe someone else around here can point you at literature/tutorials that have been written specifically for SAS on Demand.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
SAS Super FREQ
Posts: 8,716

Re: ERROR: Library LEARN does not exist.

Hi:

  When I get onto the SAS OnDemand for Academics server using SAS Enterprise Guide, I can make a folder called LEARN under my SASApp-->Files location. Then I ran a test program to make a small dataset in a library called LEARN (same name as my folder).
     

  On SAS OnDemand for Academics, your write access directory, where you can write files is /home/<your_username>, so for example, if your username is skyrit17, then your home directory would be: /home/skyrit17 You can find out your directory name by looking in your Control Center screen when you first log onto your SAS OnDemand for Academics account.

  As you can see from my screen shot, I used code like this:

 

%let path=/home/<your_username>/learn;

libname learn "&path";

    

data learn.testdata;

  set sashelp.class;

run;

    

proc contents data=learn._all_;

run;

...the reason I use the macro variable &path is so I can write programs using that placeholder for the physical location on the server. That allows me to read data from my folder on the server like this. Let's say I have a file in my home directory in the learn folder called blood.txt so the physical path is this:

/home/<your_username>/learn/blood.txt

There are 3 ways to read the file in a program and supply the physical path:

infile "/home/<your_username>/learn/blood.txt";

OR

infile "&path/blood.txt";   (assumes that the %LET statement for &path is active in your session and holds the correct path)

OR

infile "~/learn/blood.txt";

I happen to prefer the &path method, although the tilde method does also work to shorten the path you have to specify (because the ~ takes the place of the /home/<your_username> part of the physical path on the server. But the "long" name method also works.

I do remember making the files for the Learning SAS by Example book a while ago. As I remember, the book was written with Windows examples, so if you try to run those programs unchanged, you will probably have issues with C: drive locations and Windows slashes (\) -- because the SAS OnDemand server is a Unix server and needs to have Unix slashes in the code (/). You will have to unzip the files needed for the book and copy the CSV files and .TXT files up to the server location BEFORE you run the CREATE_DATASETS program, because that program uses some of the raw data files that were in the zip archive.

I am attaching a screen shot of what my program and results looked like on the OnDemand server for my test file. Do remember that the LIBNAME statement will not make a folder for you. You need to do that by right-clicking on Files under SASApp and choosing the New Folder item to create and name your new folder.

cynthia

Attachment
Esteemed Advisor
Posts: 6,634

Re: ERROR: Library LEARN does not exist.

One thing not to forget: SAS on Demand runs on a UNIX platform, which is case sensitive!

So /home/<username>/learn and /home/<username>/LEARN are two different locations and can exist in parallel.

Something that may be confusing initially to UNIX newbies.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
SAS Super FREQ
Posts: 8,716

Re: ERROR: Library LEARN does not exist.

Thanks, Kurt! Here's a screen shot that shows how I defined the directory as lowercase and the error that results if I try to refer to it in uppercase.

cynthia

Attachment
Attachment
Contributor
Posts: 26

Re: ERROR: Library LEARN does not exist.

[ Edited ]

Hi Cynthia,

 

i tried using your code. created 'learn' folder in Files tab and ran the code 

 

%let path=/home/<your_username>/learn;

libname learn "&path";

 

to create library. but it was still showing error message 'Library learn does not exist'. plz find attached.

 

version: SAS Enterprise guide 6.1(32 bit).

Attachment
Attachment
Ask a Question
Discussion stats
  • 7 replies
  • 939 views
  • 0 likes
  • 4 in conversation