02-12-2015 12:42 AM
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';
02-12-2015 03:07 AM
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.
02-13-2015 01:17 AM
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.
02-16-2015 09:53 PM
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:
libname learn "&path";
proc contents data=learn._all_;
...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:
There are 3 ways to read the file in a program and supply the physical path:
infile "&path/blood.txt"; (assumes that the %LET statement for &path is active in your session and holds the correct path)
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.
02-17-2015 01:42 AM
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.
02-17-2015 08:19 AM
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.
09-19-2016 09:31 AM - edited 09-19-2016 09:32 AM
i tried using your code. created 'learn' folder in Files tab and ran the code
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).