My instructor created a folder with data and the folder name is APN775. I was unable to use the SAS University Edition so instead I am using OnDemand. I ran my code and it came back with an error:
75 proc contents data=APN775.store
ERROR: Libref APN775 is not assigned.
I added that folder to my C drive yesterday and added a myfolder subfolder under it where the sas files are that are provided by my instructor. I added these under the folder option but based on the error code, do I need to instead add them as a libref on onDemand since it is not assigned? That is my only error. Second, If I do that, I am not understanding how to fully enter the library name after APN775. What exactly should go between these slashes / /? I tried to get more info on chat but it did not give me a resolution. Thanks.
SAS On Demand runs on a remote (cloud) server and has no access (not even a shared folder like University Edition uses) to your PC. You need to create the folder in SAS Studio and upload the contents of your local folder there (use the upload facility of SAS Studio). Then you need to declare the LIBNAME for this folder; you can retrieve the absolute path to it by right-clicking on it and selecting Properties.
So if you are using SAS onDemand does that mean you are using SAS/Studio (a browser based interface) to run your SAS code? So you are not running SAS on your PC. (Note that SAS University Edition doesn't really run on your PC either as it uses a virtual machine to run SAS. The virtual machine is running on your PC but SAS is running on that virtual machine.)
You first will need to copy the files to the server where SAS is running. SAS/Studio has an upload feature to allow you to do that.
Once you have the files and folder created on the SAS server you can use SAS/Studio to look at the properties of the folder and see where it actually is on that server. Copy the path from the properties window and paste it into your LIBNAME statement in your code. The path should look something like /home/myname/APN775 depending on how OnDemand creates your home folder and what name you created when you uploaded the files.
In the LIBNAME statement the path goes inside the quotes.
libname APN775 "/home/myname/APN775" ;
proc contents data=APN775.store;
run;
Note that SAS does not care about the case of the names you use for the libname (APN775 in this program) and datasets (store in this program), but the Unix filesystem does care about the case of the directory names. So copy the path exactly as SAS/Studio shows it to you.
On Demand cannot see your desktop, it's a cloud software, there is no connection to your computer.
To set this up in On Demand these are the rough steps you would need to have followed:
Go to the Servers File & Folders Pane in Studio.
Create a folder with the name APN775
Upload the files your professor created to the folder.
Assign a libref via a LIBNAME statement or the GUI
Then run your PROC CONTENTS.
Did you complete all the steps above? If not, try that first.
Because you're using On Demand, your path will also be different, you don't need the folders/myfolders, that's part of SAS University Edition.
It will be more likely:
To find the exact path, right click it in Server Files Folder pane, select properties and you'll find the path.
libname APN775 "/home/yourUserName/APN775/"
@NisiaS wrote:
My instructor created a folder with data and the folder name is APN775. I was unable to use the SAS University Edition so instead I am using OnDemand. I ran my code and it came back with an error:
75 proc contents data=APN775.store
ERROR: Libref APN775 is not assigned.
I added that folder to my C drive yesterday and added a myfolder subfolder under it where the sas files are that are provided by my instructor. I added these under the folder option but based on the error code, do I need to instead add them as a libref on onDemand since it is not assigned? That is my only error. Second, If I do that, I am not understanding how to fully enter the library name after APN775. What exactly should go between these slashes / /? I tried to get more info on chat but it did not give me a resolution. Thanks.
Thank you for your help and going forward I will add my screen shots to a file to attach so you can see what I am saying.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.