BookmarkSubscribeRSS Feed
skyrit17
Calcite | Level 5

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';

7 REPLIES 7
Kurt_Bremser
Super User

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.

skyrit17
Calcite | Level 5

Hmm which for of SAS is best for that book?

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

Kurt_Bremser
Super User

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.

Cynthia_sas
SAS Super FREQ

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


make_learn_folder_and_library_SODA.png
Kurt_Bremser
Super User

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.

Cynthia_sas
SAS Super FREQ

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


created_as_lowcase.pngerror_msg_if_use_wrong_case.png
satish123
Fluorite | Level 6

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).


error.jpglearn.jpg

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 2514 views
  • 0 likes
  • 4 in conversation