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

Hello all,

Is it possible to create a permanent library that points to a local folder on my computer while using SAS Studio (SAS on Demand for Academics)?

 

I have tried the simple libname statements but to no success, like:

libname library "C:\SASonDemand";
libname library "/pbr/biconfig/940/Lev1/SASApp/C:/SASonDemand";

 

Is it possible within SAS Studio to create a folder like (C:\SASonDemand) and have the permanent library point to it? Or, must all permanent libraries be contained within the SAS Studio environment?

 

Thank you for your time.

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

@kofi_appiah wrote:

Thank you. So SAS studio does not allow the uploading of SAS code or data sets from my local drive? Thus, must everything be created or generated within the SAS studio environment?


You can upload and download files (code files, datasets, text files, etc).  You just have to use the point and click interface in your browser to do it.

View solution in original post

8 REPLIES 8
Tom
Super User Tom
Super User

SAS/Studio is a tool that allows you to use your BROWSER to manipulate and run SAS code.

The SAS code itself will run on SAS session that is running on the application server that your SAS/Studio session is connected to.

SAS on Demand for Academics is a particular SAS/Studio installation.  The server that it uses to run SAS is located at SAS.  So if you want to make libref that points to some directory where you can store SAS datasets then that directory needs to be on the machine where SAS is running.  So you need to place the files in your home directory on the SAS server, not on the PC that you happen to be running the browser that is allowing you to access SAS/Studio.  Even if there was some magic that the browser could do that would allow SAS/Studio or SAS code to reach over the internet back to your PC and grabs files tomorrow you might connect to SAS/Studio from a different browser on a different PC.

kofi_appiah
Fluorite | Level 6

Thank you, it is a bit clearer. So how do I find my home directory on the SAS server? Please see screenshot.

Thank you.

kofi_appiah_0-1658333010463.png

 

Tom
Super User Tom
Super User

Look under Server Files and Folders.  Only LIBREFs that have been defined will appear in LIBRARIES.

Tom_0-1658333866481.png

 

On UNIX (which is where SAS is running) you can normally just use ~ as shortcut for referencing your home directory.

 69         data _null_;
 70           infile '~/test1.csv' obs=3;
 71           input;
 72           list;
 73         run;
 
 NOTE: The infile '~/test1.csv' is:
       Filename=/home/XXX/test1.csv,
       Owner Name=XXX,Group Name=oda,
       Access Permission=-rw-r--r--,
       Last Modified=06Dec2021:20:14:49,
       File Size (bytes)=384
 
 RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0                      
 1         Alfred,M,14,69,112.5 20
 2         Alice,F,13,56.5,84 18
 3         Barbara,F,13,65.3,98 20
 NOTE: 3 records were read from the infile '~/test1.csv'.
       The minimum record length was 18.
       The maximum record length was 20.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds

 

kofi_appiah
Fluorite | Level 6

With your guidance, I tried the home directory listed at the bottom of the console (highlighted in second screenshot) and it works, finally. I created (I hope) a permanent folder called 'Testing' for which I now see in the libraries.

Thank you.

 

kofi_appiah_0-1658346829545.png

kofi_appiah_2-1658346927642.png

 

kofi_appiah_3-1658346992881.png

 

 

 

Reeza
Super User

@kofi_appiah wrote:

 

 

Is it possible within SAS Studio to create a folder like (C:\SASonDemand) and have the permanent library point to it? Or, must all permanent libraries be contained within the SAS Studio environment?

 

 


It is not possible to create a permanent library to your local drive, all permanent libraries must be contained in the SAS Studio Environment. 

You can navigate that environment using the Servers Files & Folders Pane. 

 

 

 

 

Cynthia_sas
SAS Super FREQ
Hi:
@Reeza is correct, you cannot write to your C: drive directly from a program that you run in SAS Studio. so you must define your libraries and write your output to folders under your Files (Home) location. However, AFTER you create data or output, if you want to save it locally, you can find the file(s) in your Server Files and Folders panel and download selected files to your local machine. On my system, the downloaded files go to my Downloads folder and then I can move them from there to a different folder. However, once downloaded, you cannot read them with SAS Studio. Programs running in SAS Studio can only access data in folders that are under the Files (Home) location.
Cynthia
kofi_appiah
Fluorite | Level 6

Thank you. So SAS studio does not allow the uploading of SAS code or data sets from my local drive? Thus, must everything be created or generated within the SAS studio environment?

Tom
Super User Tom
Super User

@kofi_appiah wrote:

Thank you. So SAS studio does not allow the uploading of SAS code or data sets from my local drive? Thus, must everything be created or generated within the SAS studio environment?


You can upload and download files (code files, datasets, text files, etc).  You just have to use the point and click interface in your browser to do it.

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!

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
  • 8 replies
  • 2317 views
  • 5 likes
  • 4 in conversation