In SAS Studio (version 5) I have created a new dataset, which I want to continue using for analysis in the coming weeks. I don't want to create this dataset every time I want to us it, so I would like to save this dataset on SAS Drive. However, I am not able to do this.
I tried creating a new library (using: libname MyData '/Users/username/My Folder' ;), but when I try to save the dataset in the library MyData I get the error message: 'library does not exist' (although the library MyData does show up in the list of libraries) I also tried saving the dataset to the library Public, but after logging out the dataset disappears from this library (even though other datasets in this library do not disappear), so this also doesn't seem to be a solution.
So how can I save a dataset created in SAS Studio permanently on SAS Drive?
I guess you are using University Edition. The pathname for the shared folder from within the virtual machine that runs UE is
/folders/myfolders
if you set up your VM correctly.
The path you supplied is that of the host operating system, which is not "visible" to the VM.
I am using the SAS Cloud Environment to run SAS Studio
I have no idea about the directory structure of the SAS cloud used for UE, but from my experience UNIX admins (almost) never
Anyway, check for the correct names, always keeping in mind that UNIX is case-sensitive.
SAS UE is M6, SAS OnDemand for Academics is M5.
SAS Studio is 3.7 and the SAS version is 9.4 TS1M5.
You need to find the path, and it's usually something like:
libname myFiles '/home/userID/folderNameYouCreate';
data myFiles.permanent;
set sashelp.class;
run;
Steps 1 to 5 you only do once essentially. Once you have the path you don't have to repeat those steps.
Thanks for your help Reeza, but after following all your steps I still get the same error. I have found a solution to my problem though.
The solution is to use proc casutil with a save-statement the dataset is saved permanently to the library, while copying the dataset using a data-step or proc copy only saved the dataset temporarily (it disappeared after logging out of the server) to the library.
The code is to solve the problem is:
proc casutil incaslib="casuser" outcaslib="public"; save casdata="dataset" ; run;
Yes, I am using SAS Studio in a SAS Viya environment.
@niek wrote:
Yes, I am using SAS Studio in a SAS Viya environment.
Viya is different enough that it's probably worth mentioning in future questions at the start.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.