BookmarkSubscribeRSS Feed
niek
Calcite | Level 5

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?

8 REPLIES 8
Kurt_Bremser
Super User

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.

niek
Calcite | Level 5

I am using the SAS Cloud Environment to run SAS Studio

Kurt_Bremser
Super User

I have no idea about the directory structure of the SAS cloud used for UE, but from my experience UNIX admins (almost) never

  • use uppercase in first-level directories (/Users is most likely /users)
  • use blanks in directory names (also see Maxim 44, if you did that)

Anyway, check for the correct names, always keeping in mind that UNIX is case-sensitive.

Reeza
Super User

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;
  1. Navigate to the servers files and folders pane
  2. Create a folder to save your data sets
  3. Right click the folder and select properties
  4. Copy the path
  5. Use the path in you libname statement (as above) 
  6. Use a data step, Proc copy or other proc to move your data set to the permanent library. 

Steps 1 to 5 you only do once essentially. Once you have the path you don't have to repeat those steps. 

niek
Calcite | Level 5

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;

 

Reeza
Super User
You must be using SAS Viya then?
niek
Calcite | Level 5

Yes, I am using SAS Studio in a SAS Viya environment.

Reeza
Super User

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

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
  • 8 replies
  • 2183 views
  • 1 like
  • 3 in conversation