Introducing SAS OnDemand for Academics

In the 1960s, the Department of Agricultural Economics at North Carolina State University needed powerful tools to support their research projects. In response, NCSU built a consortium with seven land-grant universities and embarked on a project to develop a general-purpose Statistical Analysis System (SAS). SAS quickly gained popularity beyond academia, becoming the strongest choice for many enterprises to analyze their data.

However, in recent years, SAS has faced an increasing challenge in the rapidly evolving data analytics market. While it still remains the preferred choice in highly regulated sectors like finance and pharmaceuticals, its prohibitive subscription fees and steep learning curve have deterred many startups and individual learners. Considering that today's rapid progress in data science has been largely driven by open-source communities with their collaborative approach, SAS's nature as an expensive proprietary software suite has restricted its access to ongoing researches and talent pools in the field. Consequently, SAS has been slower in adopting cutting-edge AI models, making it look even obsolete. 

To address this challenge, SAS started SAS OnDemand for Academics. Specifically designed for academic users, such as students, professors, and researchers, SAS OnDemand for Academics offers free access to SAS software and tools via its cloud-based application, SAS Studio. This initiative aims to democratize access to SAS, enabling individual learners to acquire, practice, and apply SAS programming and analytical skills without local installation of the software.

First Look at SAS Studio

Let's navigate to SAS OnDemand for Academics. Signing into your account and clicking "Launch" will start a new session. User interface consists of three major parts: the top menu, the work area, and the navigation pane.

  1. Top Menu: Provides interfaces for overall controls within SAS Studio environment, including:
    • Search and open files that are uploaded to SAS Studio.
    • Switching back and forth to the SAS Programmer and Visual Programmer perspectives.
    • Custom your SAS Studio work environment.
  2. Navigation Pane: Manages and organizes your work files:
    • Server Files and Folders: You can browse and access the uploaded files in this section.
    • Tasks and Utilities: Collection of pre-defined tasks and workflows that you can readily employ for common data processing needs.
    • Snippets: Collection of code snippets for common tasks. 
    • Libraries: Permanently stores and organizes SAS data sets.
    • File Shortcuts: Creates and manages file shortcuts.
  3. Work Area: This is the main space where you can create your SAS programs, each of them in either SAS Programmer or Visual Programmer perspective.

SAS Studio has two different user interfaces, called "perspectives," each of which tailored to different user needs: SAS Programmer and Visual Programmer. The SAS Programmer is the default perspective when you open SAS Studio. It allows you to write, edit, run, and debug SAS codes directly. Program files you created through this perspective will have .sas extension.

On the other hand, the Visual Programmer perspective allows you to build workflows by dragging and dropping files and functionalities (items in the "Tasks and Utilities" section on the left panel). Of course, you can also add your custom SAS program to the Process Flow. Click the "+" sign on the menu bar under the work area and select SAS Program. Double clicking it will open a text editor where you can write and run your SAS program.

How to Import External Data Files?

SAS Studio is a cloud application. Prior to any data processing, you must first upload data files stored in your local machine. To upload a local file, go to the "Server Files and Folders" section on the navigation pane, and click on "Files." Next, select the destination folder under the "Files" and click "upload" button. This will open the file selection dialog, allowing you to select local data files. 

After uploading the file, you must create a new SAS data set based on the uploaded file. SAS cannot directly process raw data files like CSV or Excel; they need to be "imported" into a SAS data set, which is a data structure formatted with columns, rows, data types, and lengths. The easiest way to achieve this is by using the PROC IMPORT through the point-and-click interface of SAS Studio. 

Right-click on the uploaded data file and select "Import Data."

By default, the imported SAS data set will be saved in the temporal WORK library and named "Import." So, click "Change" and replace the library and data set name. Next, fill in the row number at which data reading should start in the "Start reading data at row." 

In a SAS data set, all columns must have appropriate lengths and data types. The "Guessing rows" field determines the number of rows read to determine these attributes. Select a number that is smaller than the entire number of rows but is reasonably large enough. All things completed, click "Save" and "Run" buttons to start data imports. 

SAS Libraries

SAS library is essentially a storage location for SAS data sets, grouping related data sets under specific names and providing callable references. Usually, SAS libraries are used to organize data sets by projects. Note that, by default, data sets are temporarily stored in the WORK library and will be automatically deleted by the end of the current session

One of the ways to create a new SAS library is the LIBNAME statement. Here's the basic syntax:

LIBNAME MyData '/path/to/your/library';

In the SAS ODA, your library paths will always begin with '/home/your-user-name/'. You can find the user name for the path at the bottom right corner on your browser.

Alternatively, you can create a library through SAS ODA's graphical interface. Navigate to the "Libraries" section on the left panel, then right click on the "My Libraries." You will fine the "New Library" button:

In the New Library window:

  • Name: Specify name for the new library. It should be descriptive, no longer than 8 characters, must start with a Roman alphabet, cannot contain any blanks or special characters other than underscore.
  • Path: The directory where the library is located, equivalent to the file path specified in a LIBNAME statement. You may click the Browse button to select the directory for the new library.
  • Re-create this Library at start-up: Optionally, you can set SAS to "remember" the new library every time you start a new SAS Studio. This ensures that the library exists in a new session.

The allocated libraries can be found under "My Libraries" within the "Libraries" section. Inside "My Libraries," you'll see a list of pre-allocated libraries. These libraries contain example data sets used in SAS Help, as well as coordinate data for spatial analysis.

Working with SAS Programs

SAS Studio includes a color-coded, syntax-checking editor for editing new or existing SAS programs. You can also edit SOURCE entries in SAS catalogs. The editor includes a wide variety of features such as autocompletion, automatic formatting, and pop-up syntax help. With the code editor, you can write, run, and save SAS programs. You can also modify and save the code that is automatically generated when you run a task.

SAS Studio also includes several sample code snippets that you can use to make programming common tasks easier.

In the code editor, you can use the programming languages for SAS 9.4 or SAS Viya. 

Opening a Program

You can open SAS programs from the Server Files and Folders section of the navigation pane. To open a program, expand the appropriate folder and double-click the program that you want to open, or drag it into the work area. The program opens on a new tab in the work area.

Note: Opening very large program files can affect your performance. If you open a program file that is greater than 10MB, you are prompted to confirm whether you want to continue opening the file. 

Creating a Program

You can create a SAS program from the Server File and Folders section of the navigation pane. 

Working with SAS Queries

df

Working with Process Flow

Under the Visual Programmer perspective, you can visually explore and overview the whole process of your data analysis project. Each node is connected in the order of data processing to visually confirm the workflow at a glance. Work files in this perspective will be saved as Process Flow files with .cpf extension.

The process

Post a Comment

0 Comments