BookmarkSubscribeRSS Feed
bhickma30
Calcite | Level 5

I am having issues figuring out what needs to be fixed in my code to create my library. I've followed the steps exactly from the SAS website:

 

%let path=/home/bhickma30/EPG3M6;
%let pathout=&path/output;

libname pg3 "&path/data" filelockwait=20;

 

and when I run it, it says my library does not exist. I double checked and the name shows up under my library, but it's empty. Is there something I'm missing?

7 REPLIES 7
ballardw
Super User

What environment are you working in? Stand alone SAS installation, SAS studio connecting to a server, SAS University edition?

 

In two of the above the "path", it that is supposed to be on your machine would be incorrect. If you have a server then extra work, as in talk to your SAS admin, to set up space.

If SAS University edition the paths start from the virtual machine installation and by default paths would start with /folders/myfolder. Your files would have to be in that relation for the virtual machine to find things.

 

Check case of names as well.

 

 

bhickma30
Calcite | Level 5
I'm using SAS Studio. I followed the directions that they provided on their website step by step, and I went back through and deleted everything and re-downloaded it just to make sure I hadn't made a mistake somewhere. I still ended up with the same result.
Tom
Super User Tom
Super User

@bhickma30 wrote:

I am having issues figuring out what needs to be fixed in my code to create my library. I've followed the steps exactly from the SAS website:

 

%let path=/home/bhickma30/EPG3M6;
%let pathout=&path/output;

libname pg3 "&path/data" filelockwait=20;

 

and when I run it, it says my library does not exist. I double checked and the name shows up under my library, but it's empty. Is there something I'm missing?


Are you following instructions from a class?  If so which class?  Are you interfacing with SAS? (SAS/Studio, Enterprise Guide, Display Manager?)  What type of machine is your SAS session running on? Real or Virtual , Windows  or Unix? Something else?

 

Your libname statement not only assumes that /home/bhickma30/EPG3M6 exists, but that it is a directory and not a file.  I also assumes that /home/bhickma30/EPG3M6/output exists and is a directory.

bhickma30
Calcite | Level 5

 

  • In the Files and Folders panel, navigate to the EPG3M6 folder that you created in Task 1.
  1. Double-click libname.sas to open it. Don't run the code yet - you must edit the code before you run it.
  2. Right-click the EPG3M6 folder in the Files and Folders pane and select Properties. Highlight the file path shown in Location and copy it. Close the Folder Properties window.
  3. In the Code window, edit the program as follows:
    1. Highlight FILEPATH and paste the file path that you copied in the previous step.
    2. Do not make any other changes to the program.
  4. Click Run 
     
     or press F3 to submit this program to SAS.

I'm following this procedure from a course they have on SAS, and I was trying to download all the documents I needed. I did everything step by step in SAS Studio.

 

Tom
Super User Tom
Super User

You listed the contents of the instructions, but did not specify which set of instructions you are following.  There are many courses and versions of the course instructions are tailored for the environment you are using to run SAS.  Make sure you are using the course/instructions for your SAS environment.

 

You say you are using SAS/Studio.  But not what version of SAS you are using. Or where the SAS is running. SAS/Studio only runs the user interface on your local machine using the browser that you used to connect to the server.  In the back end it starts SAS sessions on some SAS server.  The path you use in your code needs to work on that machine, which might not be your machine.

 

In particular if you are using SAS University Edition then SAS is running in a virtual machine and you will only have access to files that are in the /folders/myfolders/ location in that virtual machine.  So /home/... will never work if you are using SAS University Edition.

 

That is why the instructions say to find the path using the Server Files and Folders area of the SAS/Studio interface. That will show the name that the files has when viewed from the machine where SAS is running.  Do not use any local apps your PC might have for looking at files and folders. Only use the window in the SAS/Studio interface.

 

And if you are using SAS University Edition then the download needs to be into the folder on your local machine that you shared with the virtual machine that you setup to run SAS and SAS/Study server.  If it is not in the location on your physical machine that is shared with virtual machine then you will not be able to find the files in the Server Files and Folders area of the SAS/Studio user interface.

Cynthia_sas
SAS Super FREQ

Hi:

  Looks like the Programming 3 e-learning class and what you posted looks like the SAS University Edition instructions. The fact that your path starts with /home/bhickma30 implies that you are using SAS OnDemand for Academics NOT University Edition.

 

  If you start Virtual Box or VMWare player before you open SAS Studio then you follow the University Edition instructions. But if you are going to the SAS Control Center and clicking on SAS Studio from the dashboard and you have a /home folder, then you need to follow THESE instructions, which are written explicitly for SAS OnDemand for Academics:

 pg3_soda.png

  The instructions are not interchangeable. If you are using SAS OnDemand, notice that there is not any editing of the libname program required in these instructions.

 

  The only thing that you need to do is create the class folder under your Files (Home) top node and then open and run the createdataPG3_oda.sas program -- this program actually creates your LIBNAME.SAS program -- you don't have to edit the program in these instructions, which are specifically for SAS OnDemand for Academics users.

 

Hope this helps,

Cynthia

 

LeonidBatkhan
Lapis Lazuli | Level 10

Hi bhickma30,

 

You are creating a library pg3 that points to location /home/bhickma30/EPG3M6/data .

Apparently that directory does not exist.

SAS does assign your library to a non-existing directory (that is why you see it empty).

You either need to create this directory before you assign your library, or use the following option before your libname statement if you want SAS to create that directory for you:

options dlcreatedir;

Hope this helps.

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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
  • 1005 views
  • 0 likes
  • 5 in conversation