BookmarkSubscribeRSS Feed

Getting started with SAS® OnDemand for Academics

Started ‎06-08-2021 by
Modified ‎06-15-2021 by
Views 14,979

 

How to copy and paste code from SAS University Edition to SAS OnDemand for Academics

If you know how to program in SAS Studio via SAS University Edition, you don't need to relearn the SAS programming language. Many SAS programs can be copied and pasted from SAS Studio in SAS University Edition to SAS Studio in SAS OnDemand for Academics without any changes. The following code accesses the cars data set in the sashelp library:

 

proc freq data=sashelp.cars;
tables origin;
run;

 

You can enter and execute the code in SAS Studio in SAS University Edition.

 

Two steps to copy and paste the code into SAS OnDemand for Academics

 

  1. Highlight the code and copy it to the clipboard by pressing Ctrl+C (Windows and Linux) or Command+C (Mac).
  2. In a new program in SAS Studio in SAS OnDemand for Academics, paste the copied code into the CODE tab by pressing Ctrl+V (Windows and Linux) or Command+V (Mac).

 

Without modification, the copied and pasted code executes in SAS Studio in SAS OnDemand for Academics.

 

Five steps to upload data and programs into SAS OnDemand for Academics

 

Use the point and click tools in SAS Studio in SAS OnDemand for Academics to upload data and programs from your computer:

 

  1. In the Server Files and Folders tab in SAS Studio, right-click the directory to which you’d like to upload your files.
  2. Select Upload Files.
  3. Select Choose Files.
  4. Browse your computer.
  5. Select your files and click Upload. Your selected files will be uploaded and available in SAS Studio in SAS OnDemand for Academics.

 

How to modify your libname statement so it works in SAS OnDemand for Academics

 

If you have written programs in SAS Studio in SAS University Edition, it’s easy to make modifications to your libname statements and file references so your programs will run in SAS Studio in SAS OnDemand for Academics. You do not need to open SAS University Edition in order to access the My Folders directory. In SAS Studio in SAS University Edition, the My Folders directory is referred to using the following path: “/folders/myfolders”. This path in a libname statement or file reference allows you to access data.

 

In SAS Studio in SAS OnDemand for Academics, the Files (Home) directory can be referred to using the following path “~/”. By simply changing “/folders/myfolders” to “~/” the same program runs in SAS Studio in SAS OnDemand for Academics. Note: Subdirectory paths and file references are case-sensitive in SAS OnDemand for Academics.

 

How to upload and access local data into SAS OnDemand for Academics

 

All SAS Studio users can upload local data (such as SAS data sets or .csv files) to use within the application (as well as with other SAS OnDemand for Academics applications). Only the user who uploaded the data can use it. This data is stored on the SAS OnDemand for Academics servers. 

 

Note: If you are an instructor and need to upload data that can be accessed by all the students who register for your course, see Uploading Course Data.

 

  1. Log on to SAS OnDemand for Academics. Your SAS OnDemand for Academics Dashboard is displayed.

Note: If you do not have an account, see SAS OnDemand for Academics Registration Instructions.

 

  1. Under the Applications tab, click SAS® Studio.
Figure 1.JPG

 

  1. In SAS Studio, select the folder that you want to upload data to. Expand Files (Home) and then select an existing folder or select à Folder to create a new folder.
Figure 2.JPG

 

 

  1. Select the folder that you want to upload data to. Click the up arrow.

 

Figure 3.JPG

 

The Upload Files dialog box is displayed.

 

  1. Select the file to upload in the Upload Files dialog box. Click Upload.

 

Figure 4.JPG

  

After uploading, you see your local data in the folder that you selected.

 

Figure 5.JPG

 

Note: You can refresh your course data by uploading the data again. If you upload your data again, then your existing, uploaded data is overwritten.

Note: You have a limit of 5GB of individual data storage space.

 

If video instructions work better for you, here is a tutorial just under 4 minutes long:

Access and upload data in SAS OnDemand for Academics.JPG

 

 

How to access uploaded data with a LIBNAME Statement 

 

After you have uploaded local data, you can use that data within SAS Studio. If you are associated with courses that use either SAS Enterprise Guide or SAS Enterprise Miner, then you can also access your uploaded data from those programs by specifying a LIBNAME statement.

 

To access your uploaded data within SAS Studio, SAS Enterprise Guide, or SAS Enterprise Miner, determine the appropriate LIBNAME statement and then use that LIBNAME statement in your code.

 

  1. From within SAS Studio, expand the Server Files and Folders folder and then locate the folder where you uploaded data.
Figure 6.JPG

 

  1. Right-click on the folder and select Create > Library.

 

Figure 7.JPG

 

The New Library dialog box is displayed.

 

  1. Provide a name for the library. The library is created and will now be available from the Libraries folder.

 

Figure 8.JPG

 

  1. Expand the Libraries folder. Right-click on the library that you just created and select Properties.

 

Figure 9.JPG

 

The Library Properties dialog box is displayed.

 

  1. Copy or make note of the library path so that you can use it to define a LIBNAME statement.

  

Figure 10.JPG

 

For example, if your library path is /my_shared_file_links/UUUUUUUUand you want to create a library named mydata, then the LIBNAME statement would be the following:

 

LIBNAME mydata "/my_shared_file_links/UUUUUUUU";

 

  1. Use the LIBNAME statement within your SAS programs in SAS Studio or SAS® Enterprise Guide® to access your data. If you are using SAS® Enterprise Miner™, then you can assign the library by including the LIBNAME statement in your Project Start Code.

 

Note: SAS Enterprise Guide users can also upload local data directly within SAS Enterprise Guide and use it as needed. Unlike the process documented in this guide, the uploaded data remains available only for the current SAS Enterprise Guide session unless it is downloaded before the session ends. For more information about SAS Enterprise Guide, see SAS Enterprise Guide documentation.

 

Questions about getting started with SAS OnDemand for Academics? SASoda@sas.com

 

 

Comments

Good Morning,

 

I'm getting this error when using data statement. How do I fix it?

 

"ERROR: The data set MYSAS.U2 must use a CAS engine libref"

#These steps work.

libname mysas "/home/devcmj0/mysas";

PROC IMPORT DATAFILE = "/home/devcmj0/mysas/ass.csv" DBMS='csv' OUT=mysas.u1 REPLACE;
RUN;
data mysas.u2;set mysas.u1;run;

 

#Below steps do not work
proc mbanalysis data=MYSAS.u2 items=60 support=100;
output out=mysas.out outfreq=mysas.outfreq outrule=mysas.outrule;
customer ID;
target NUM1;
run;

 

What is required to fix this issue?

 

Thank you,

Dev

Hi @jayadevan12, sorry you're having trouble! Please post your question on the SAS Software for Learning Community, where far more experts who can help are watching for such questions.

Thanks for the delightfully good and helpful video. I just want to get in and test some code and this video gave me all the basic info I needed.

@JaySC thank you for taking the time to comment! 

Version history
Last update:
‎06-15-2021 03:47 PM
Updated by:
Contributors

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Tags