BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
NisiaS
Fluorite | Level 6

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. 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
I did say to right click the file in the Servers Files and Folders pane but I understand how that could be missed 😉
Glad you got it working though!

View solution in original post

11 REPLIES 11
Kurt_Bremser
Super User

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.

Tom
Super User Tom
Super User

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.

 

 

 

 

NisiaS
Fluorite | Level 6
So, if this is where I have housed my data, on the C drive, the location is my path that goes between the slashes? Also, do I just include that as a line of code at the top or do I have to add something under the library folder?
[cid:17b448c8-c8c1-4fdd-ac4a-cd38e3d91f97]
Reeza
Super User

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. 




NisiaS
Fluorite | Level 6
So, I have added the contents of the folder to SAS Studio. Under the files(home)=>APN775 below is a list of all the files from the class as indicated below. I uploaded them there.

[cid:793f15ed-a7b7-481e-b5a2-31038b303c81]


So those files are uploaded on SAS Studio.

Next, assign a libref via a LIBNAME statement or the GUI is where I am stuck. Here is where I saved the folder on my C:Drive

[cid:57bfdf83-8bb1-490b-b380-bafd97b6550b]


Do I enter libname APN775 '/????????/' (is this where I enter the path under location?)


I get what you are saying about using the cloud. Makes perfect sense. I just can't figure the rest out. Now do I have to go to the library to add something or is this just a code line at the top of the page where I write my code?


You are correct I am not using the SAS UE but that is how I started yesterday, when I was trying to load it to my computer and ran into problems. I already had those folders created and never changed them. Do I need to move the folders somewhere else and/or rename it?

Reeza
Super User
Your screen shots are not being included in your posts. Are you replying via email? If so, it does not embed images.

As mentioned before, nothing on your C drive is accessible to SAS On Demand.

Did you follow the steps exactly that I listed in SAS Studio On Demand or the UE?
It must be the On Demand instance.
NisiaS
Fluorite | Level 6
Yes, I am responding and adding screen shots via email, but I see they are not coming through so let me try again to explain it. Originally, I was trying to add the virtualization, but my computer would not work with it. So, I did the onDemand option. Now I did do what you said, add the files to SAS Studio under APN775 folder. They are listed there. Next, you mentioned using libname.

I understand that the cloud is unable to read my C drive. But I am still not sure what my statement should read if the properties tab says that my location is C:\SASOnDemand\APN775.

I had already created this folder and never changed it and added my data to it. Yes, I followed your steps exactly.

Do I need to create a library, or can I just add the statement to the top of the code when I write it?



Reeza
Super User
You'll need to add the screenshots. It doesn't make sense that it's linking to your C drive at all but I don't know where the mistake is....
NisiaS
Fluorite | Level 6
I didn't link it to the C drive. The only thing I did there was add the files to the file folder from there after I added the folder to My libraries. Then I started connecting the paths you were saying I needed to use. I had to use the properties option in SAS not on my computer. That was where I was not understanding what you all were saying. When I did that, all the code errors went away.
Reeza
Super User
I did say to right click the file in the Servers Files and Folders pane but I understand how that could be missed 😉
Glad you got it working though!
NisiaS
Fluorite | Level 6

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. 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 11 replies
  • 940 views
  • 4 likes
  • 4 in conversation