Using SAS Studio

About Using SAS Studio

When you sign on to SAS Studio, the Start Page is available, so you can quickly get started writing a new SAS program, importing data, or creating a query. Use the icons to access the six sections of the navigation pane.

Note: To sign out of SAS Studio, click the button with the first initial of your user name on the far right of the application toolbar and select Sign out. Do not use the Back button on your web browser.
SAS Studio Main Window

At the top, the application bar enables you to access other SAS applications. Click the search icon to search for items across SAS applications.

The main window of SAS Studio consists of a navigation pane on the left and a work area on the right. The navigation pane provides easy access to your open files, your folder shortcuts and SAS content, your tasks and snippets, the libraries that you have access to, your Git repositories, and your file references. The Open Files section is displayed by default. The File References section is not displayed by default, but can be opened by selecting Viewthen selectNavigation panesthen selectFile References. For more information, see Using File References.

The work area is used to display your data, code, tasks, logs, and results. As you open these items, they are added to the work area as windows in a tabbed interface. When you first open SAS Studio, the Start Page tab is displayed in the work area by default. For more information, see Using the Work Area.

Using the Navigation Pane

About Using the Navigation Pane

You can expand the sections of the navigation pane by clicking the section that you want to view. To close and reopen the navigation pane, click a section button twice.

Note: If you want to drag an item to another location in a section of the navigation pane that has a scroll bar, drag the item to the top right or lower right corner of the pane to scroll upward or downward.

Accessing Your Open Files

The Open Files section of the navigation pane enables you to quickly view and access all of the files that you have opened in your current SAS Studio session. To access a file from the list of open files, click the file that you want to view. You can also save changes to all files in the list by clicking Save all.

Using the Explorer

The Explorer section in the navigation pane enables you to access files and folders from your folder shortcuts, your server file system, and your SAS Content server locations. For more information, see SAS Drive: Getting Started.

Note: The ability to access files on a SAS Content server is available only in SAS Studio 5.2 (Enterprise). For more information, contact your site administrator.

You can use the Explorer section to create folders and folder shortcuts as well as download and upload files. From the folders tree, you can expand and collapse folders, copy and move items, and open items in folders by double-clicking them or dragging them to the work area. In addition, you can open files from your folders and folder shortcuts by clicking Open on the SAS Studio toolbar.

You can change the files that are displayed in the Explorer section in the following ways:

  • To view any hidden files and folders in a folder, right-click the folder and select Show hidden items.
  • To display only SAS program files, click More Options button and select Show .sas files.
  • To display only SAS log files, click More Options button and select Show .log files.

You can view items in a folder as text by right-clicking the file and selecting View file as text.

To open a file as a SAS program, right-click the file and select Open as program.

To create a folder shortcut:

  1. Click Explorer button in the navigation pane to open the Explorer section. Next, click New button and select Folder shortcut. The New Folder Shortcut window appears.
  2. In the Name box, enter the name of the folder shortcut.
  3. Click Browse button to select a folder. To create a folder, click New button.
  4. Click OK to create the folder shortcut. The new shortcut is added to the list of folder shortcuts.
Note: You can rename a folder shortcut by selecting the folder shortcut in the Explorer section and clicking Properties button. In the Shortcut Properties window, enter a new name in the Name box.

To create a folder, select the folder in the Explorer section in which you want to create the folder. Click New button and select Folder. The New Folder window appears. Enter the name of the new folder. The new folder is added to the list of folders.

To download one or more files, right-click the files that you want to download and select Download file.

To upload one or more files from your local computer, select the folder to which you want to upload the files and click Upload files button. The Upload Files window appears. Click Add button to browse for the files that you want to upload. The maximum size of each uploaded file cannot exceed 100 MB.

Note: You can sort the files that are listed in the Explorer section by right-clicking the folder that you want to sort and selecting Sort by. You can sort the files by name, modified date, or size or choose no sort order. By default, the files are sorted in ascending order by file name.

Working with Tasks

The Tasks section of the navigation pane enables you to access tasks in SAS Studio. Tasks are based on SAS procedures and generate SAS code and formatted results for you. SAS Studio is shipped with several predefined tasks that you can run. You can also edit a copy of these predefined tasks, and you can create your own new tasks.

To create a new task, click New and select Task. SAS Studio creates a template in the work area that you can use to create custom tasks for your site. Custom tasks can be accessed from the My Tasks folder or from the Explorer section of the navigation pane. For more information, see Create a New Task.

To edit a task that you have created, right-click the task in the My Tasks folder and select Edit task template. The XML code that is used to create the task is opened in the work area. If you want to edit a predefined task, you must first right-click the task and select Copy as Task Template and then select either My Tasks or Explorer. For more information, see Edit a Predefined Task.

Working with Snippets

The Snippets section in the navigation pane enables you to access your saved snippets. Snippets are lines of commonly used code or text that you can save and reuse. Snippets can contain SAS code, XML code, and text. You can insert snippets in locations including the Program Editor, XML editor, text editor, job definitions, job forms, and job prompts. To insert a snippet, right-click the location where you want to insert the snippet and select Insert snippet.

SAS Studio is shipped with predefined code snippets that you can use. You can also edit a copy of these snippets and create your own custom snippets. Your custom snippets can be accessed from the My Snippets folder. For more information, see Working with Programs.

To edit a snippet that you have created, double-click the snippet to open it in the Program Editor and enter your changes. If you want to edit a predefined snippet, you must first right-click the snippet and select Copy snippet to, and then select either My Snippets or Explorer.

Note: You can edit only the snippets that are in the My Snippets folder or a folder that you can access from the Explorer section.

Working with Libraries

The Libraries section of the navigation pane enables you to access your SAS libraries. SAS tables are stored in SAS libraries. From the Libraries section, you can open SAS tables and add them to your programs. You can use the Libraries section to expand a table and view the columns in that table. The icon in front of the column name indicates the type.

Note: Caslib names cannot be longer than 256 characters. SAS librefs are limited to eight characters.

Here are examples of common icons for the column types.

Icon

Type of Column

Character icon

Character

Numeric icon

Numeric

Date icon

Date

Datetime icon

Datetime

You can drag tables and columns from the Libraries section to a program, and SAS Studio adds the names of the dragged items to your program. The cursor changes as you drag an item to indicate when you can drop the item to insert it in the program. If the item name is a reserved word in a database, SAS Studio creates a name literal by automatically adding quotation marks and a lowercase letter n to the item name.For more information, see Opening and Creating Programs.

You can also drag tables from the Libraries and Explorer sections to other locations in the work area to open them.

Note: The Sasuser library is read only, as in any SAS server environment. You cannot save content to this library.

You can also create new libraries and assign existing libraries.

To create a new library:

  1. Click Libraries button in the navigation pane and then click New libraries button. The New Library window appears.
    New Library Window
  2. In the Name box, enter the libref for the library. The libref must be eight characters or fewer.
  3. In the Path box, enter the physical path where the library resides. The path must be a location that you can access on the SAS server to which SAS Studio is connected.
  4. In the Options box, specify any configuration options that you need. For the appropriate options, see the documentation for your operating environment.
  5. If you want to access this library each time you use SAS Studio by adding it to your SAS autoexec file, select Re-create this library at start-up.
  6. Click OK to create the library. The new library is added to the list of libraries in the navigation pane.

Using File References

File references enable you to quickly access files that you specify. You can create a file reference to a file in your SAS Content folder, via a URL, or on your SAS server. You can use the SAS Studio user interface to create a file reference to a file in your SAS Content folder or via a URL. To create a file reference to a file on your SAS server, you must use the FILENAME statement.

Note: You can also use the FILENAME statement to create a file reference to a file in a remote location that is accessible by your SAS server.

To create a new file reference to a file in your SAS Content folder or via a URL:

  1. Click File References button in the navigation pane and then click New file reference button. The New File Reference window opens.
    New File Reference window
    Note: If the File References button is not available in the navigation pane, select Viewthen selectNavigation panesthen selectFile References.
  2. In the Name box, enter the file reference name.
  3. Use the Access method box to specify how to access the file:
    • DISK - accesses the file from your SAS file system. In the Location box, browse to find the file that you want to use.
    • FILESRVC - accesses the file from your SAS Content folder. In the Location box, browse to find the file that you want to use.
    • URL - accesses the file by using the specified URL. In the URL box, enter the URL for the file.
  4. If you want this reference to be available the next time you use SAS Studio, select Re-create this file reference at start-up.
  5. Click OK to create the file reference. The new file reference is added to the list of file references in the navigation pane.

To create a file reference to a file on or accessible by your SAS server:

  • In the Program Editor, enter and run a FILENAME statement using the following syntax:
    FILENAME fileref 'external-file';
    Note: Make sure that you specify the complete pathname for the external file and use the proper path syntax for the operating system that your SAS server is running. For example, Microsoft Windows uses backslashes (\) in its pathnames, and UNIX uses forward slashes (/).

You can open a file from a file reference by double-clicking it or dragging it to the work area.

Working with Git Repositories

The Git Repositories section in the navigation pane enables you to access the basic Git features from within SAS Studio. These features include cloning repositories, committing and stashing file changes, pulling and pushing files, viewing your repository history, creating and merging branches, rebasing a branch, and performing a basic differentiation between files in your local repository. For more information, see About Git Integration in SAS Studio.

Customizing the Navigation Pane

By default, five sections of the navigation pane are displayed when you open SAS Studio in the Standard perspective. To customize which sections are displayed, click View and select Navigation panes. Select or clear any sections that you want to add or remove. The navigation pane is updated immediately.

Note: The File References section is not displayed by default.

Using the Work Area

About Using the Work Area

The work area is the main portion of the SAS Studio application for accessing programs and tasks and for viewing data. The work area is always displayed and cannot be closed. When you open a program, task, or table, the windows open as new tabs in the work area. The code, log, and results that are associated with programs and tasks are grouped together under the main tab for the program or task.

When you first open SAS Studio, the Start Page tab is displayed in the work area by default. The Start Page provides quick access to a few basic tasks (for example, creating a program or query) and links to learning resources. If you close the Start Page tab, you can re-open it by selecting Viewthen selectStart Page. You can use the Show Start Page option to control whether to display the Start Page tab each time you start SAS Studio. For more information, see Setting the Start Up Preferences.

Work Area with Start Page

Customizing the Work Area

By default, the work area is displayed beside the navigation pane, but you can maximize the work area and hide the navigation pane. You can also close all of the tabs in the work area at once.

To maximize the work area, select Viewthen selectFullscreen.

Note: To reopen the navigation pane, double-click any tab in the work area or right-click a tab and select Restore.

You can also close some or all of the open tabs in the work area. To close all tabs that are open in the work area, right-click any tab and select Close all. To close all tabs except the active tab, right-click the active tab and select Close others. You are prompted to save any unsaved programs or tasks.

Rearranging the Tabs in the Work Area

In the work area, you can rearrange the tabs by moving them to the left or right. You can also create separate vertical and horizontal groups and move tabs between the groups. To rearrange a tab, right-click the tab that you want to move and select the appropriate option.

Creating a New Tab Group in the Work Area

Searching in SAS Studio

You can use the Search feature to search all of the sections of the navigation pane. You can specify which sections and which types of items you want to include in your search. You can also specify whether you want the search to be case-sensitive and match whole words only.

To access the Search feature, select Viewthen selectSearch. The Search tab opens in the work area.

Search Tab in the Workspace

To search for an item, enter the text that you want to search for in the search term box. To specify the areas of the navigation pane to search, click Options button. By default, SAS Studio searches your user home folders in the Explorer section of the navigation pane.

Search Tab with Options Window

To make your search case-sensitive, click Match case button. To match the whole word in your search, click Match whole word button.

When you have specified your search criteria, click Search button. You can open items in the search results by double-clicking them.

Search Window with Results

Using the Console

The Console window displays a list of all of the messages, such as error messages and warnings, that are generated as you run programs and tasks. To open the console, select Viewthen selectConsole. If you minimize the console tab, you can click Restore console button in the lower right corner of the work area to restore the console or Maximize console to maximize the console.

You can use the buttons at the top of the window to filter the types of messages that are displayed. By default, all types of messages are displayed. The messages are cleared by default when you sign out of SAS Studio. You can manually clear the messages from the console by clicking Clear All.

Console Window Showing All Types of Messages

Using the Submission Status Window

The Submission Status window displays information about the programs, tasks, and queries that you run in SAS Studio. To open the Submission Status window, select Viewthen selectSubmission Status or click Submission in the lower right corner of your SAS Studio browser window.

The Submission Status window includes an entry for each time you have run a program, task, or query. You can use the Submission Status window to return to an earlier version of a program, task, or query. When you click a program, task, or query from the Submission Status window, you open the version of the program, task, or query that was run at that time. The program or automatically generated task or query code opens in a new tab from which you can make and save changes.

When you position your mouse pointer over the name of a program, task, or query, the following options become available:

  • Remove Submission from List button – removes the submission from the Submission Status window.
  • Cancel Submission button– cancels the submission if it is currently running.

You can subset the messages that are displayed by clicking the type of message that you want to view. You can also click Clear All to remove all entries from the list and Cancel All to cancel all programs, tasks, and queries that are currently running, excluding background submitted jobs.

Submission Status window with sample submission messages
Note: When your SAS Studio session ends, all items from the Submission Status window are removed. You can also manually clear items. You can retain background submission items for 72 hours if your system administrator enables the persistBackgroundSubmitJobs configuration property in SAS Environment Manager. To specify options for saving the background submission log and output files, see Setting Background Submit Preferences.

Using the Document Recovery Window

The Document Recovery window enables you to recover or delete the files that SAS Studio has automatically saved. By default, SAS Studio automatically saves your open files, such as SAS programs, queries, and tasks, if SAS Studio times out while you are away or closes unexpectedly due to a situation such as a power loss.

To open the Document Recovery window, select Viewthen selectDocument recovery, or click Recover in the lower right corner of your SAS Studio browser window.

Note: The Document Recovery window is available only if you have recovered documents. You can use the Enable document recovery option to manage the document recovery feature. For more information, see Setting General Preferences.
Document Recovery window

For each file in the Document Recovery window, you can choose from among these options:

  • No action - retains the file in the list of recovered documents. The file continues to be available from the Document Recovery window until you recover it or delete it.
  • Recover - opens the file in a new tab in the work area. The file is deleted from the list of recovered documents.
  • Delete - deletes the file from the list of recovered documents.
Note: You can also recover or delete all of the documents by clicking Recover All or Delete All.

When you have specified actions for the recovered files, choose one of these options:

  • Apply and Close - applies the selected actions to the files and closes the Document Recovery window.
  • Apply - applies the selected actions to the files, but does not close the Document Recovery window.
  • Close - closes the Document Recovery window without applying any actions to the files. The files are still available the next time you open the Document Recovery window.

Understanding Perspectives

Because SAS Studio can be used by a variety of people and groups within an organization, you can choose to view a specific subset of features, or perspective, that meets your needs best. Perspectives are sets of functionality that are customized to meet the needs of different types of users. SAS Studio includes two perspectives: the Standard perspective and the Interactive perspective.

The Standard perspective is for users who want to be able to both write SAS programs and use the predefined tasks. In the Standard perspective, SAS program files are run as a whole. By default, the Standard perspective opens with the Start Page tab and includes these sections of the navigation pane: Open Files, Explorer, Tasks, Snippets, Libraries, and Git.

The Interactive perspective is designed for users who intend to use SAS Studio mainly for writing and editing SAS programs that use interactive SAS procedures. By default, the Interactive perspective opens with the Start Page tab, and the Log and Results tabs are displayed in a separate horizontal tab group. In addition, the log data and results from all of your program tabs are appended together in one log tab and one results tab. In the Standard perspective, there are separate log and results tabs for each program. For more information, see Working with the Interactive Perspective.

Interactive Perspective with Two Program Tabs and One Results Tab

The differences between the perspectives can be viewed in the following table:

Element in SAS Studio

Available in Standard?

Available in Interactive?

Navigation Pane sections

  • Open Files

Yes

Yes

  • Explorer

Yes

Yes

  • Tasks

Yes

No

  • Snippets

Yes

Yes

  • Libraries

Yes

Yes

  • Git

Yes

No

  • File References

Yes, but not displayed by default

Yes, but not displayed by default

Ability to create and open queries

Yes

No

Ability to create and run job definitions

Yes

No

Options to recall code and clear code on submit

No

Yes

Options to generate PDF, RTF, Excel, and PowerPoint output

Yes

No

Ability to import data

Yes

No

Ability to export data

Yes

No

Ability to print data

Yes

No

Ability to validate an expression in the Filter Table Rows window

Yes

Yes

Ability to validate the autoexec.sas file

Yes

No

Ability to insert custom code

Yes

No

Ability to update column properties

Yes

No

After you have started SAS Studio, you can change the perspective that you are using by selecting Optionsthen selectChange perspective and then selecting the perspective that you want to use.

You can specify which sections of the navigation pane are displayed in SAS Studio by selecting Viewthen selectNavigation panes.

Editing the Autoexec File

The autoexec.sas file includes SAS statements that run each time you start SAS Studio and connect to your SAS server. For example, you can use the autoexec.sas file to assign libraries that you want to be available every time you use SAS Studio in both the Standard and Interactive perspectives.

Note: If you create a new library by using the New Library window, you can select the Re-create this library at start-up option to automatically add the LIBNAME statement to the autoexec.sas file. For more information, see Working with Libraries.

To edit the autoexec.sas file:

  1. Select Optionsthen selectAutoexec file.
  2. Enter the code that you want to include in the autoexec.sas file.
  3. To validate your syntax, click Run. The Log tab opens so that you can view the log.
    Note: The option to run the autoexec file is available only in the Standard perspective. For more information, see Understanding Perspectives.
  4. Click Save to save and close the autoexec file.

System Options in SAS Studio

To learn more about SAS system options, see Definition of System Options in SAS System Options: Reference.

In SAS Studio, the value for most system options applies to the next step and to all subsequent steps for the duration of the SAS session, or until you reset the system options setting.

SAS Studio sets several system options before and after each code submission to create a consistent environment. If you modify any of these options in your code, the values that you set do not persist. You must resubmit your OPTIONS statement each time you submit your code. A code submission is either all of the code on the programming tab or code that you highlight and submit.

To see in the log the options that SAS Studio sets, select Show generated code in the SAS log in the preferences.

In the SAS 9.4, SAS Studio sets these options before your code executes:

  • DATE
  • DFLANG
  • DEVICE=PNG
  • DTRESET
  • FIRSTOBS=1
  • LOCALE
  • NOSYNTAXCHECK
  • NOTES
  • NUMBER
  • OBS=MAX
  • PRINTERPATH=PDF
  • VALIDMEMNAME=EXTEND
  • VALIDVARNAME=ANY

For example, if you submit the following three lines of code, the value of the OBS option is 5 after SAS prints five rows of Sashelp.Cars. If you submit each line of code separately, PROC PRINT prints the complete Sashelp.Cars data set instead of five rows because SAS Studio sets OBS=MAX each time code is submitted.

options obs=5; 
proc print data=sashelp.cars;
run;

SAS Studio sets these system options after each code submission:

  • NOTES
  • SOURCE
  • STIMER
  • SYNTAXCHECK
  • VALIDMEMNAME=EXTEND

Inserting Custom SAS Code

You can specify the SAS code to run before or after the code for programs, tasks, queries, and imports. This custom code is always run and persists between sessions.

To include custom SAS code:

  1. Select Optionsthen selectCustom code.
  2. Specify the preamble and postamble SAS code. Click Run to validate the syntax.
  3. On the Options tab, specify where to insert the custom code. You can choose from programs, tasks, queries, and imports. You can also specify whether to include the code if you are running a background submit.
  4. Click Save.

Resetting Your SAS Session

You can terminate your current SAS session and create a new workspace session by using the Reset SAS Session option. The Reset SAS Session option terminates your current workspace session by running the ENDSAS statement and then creates a new workspace session. When the new workspace session is started, SAS Studio runs the autoexec file to initialize the session. To reset your SAS session, select Optionsthen selectReset SAS session.

Note: All files in the Work library are deleted when you reset your SAS session.

Managing Keyboard Shortcuts

SAS Studio includes many keyboard shortcuts that you can use to perform a task. For a list of keyboard shortcuts, see Keyboard Shortcuts in SAS Studio: Accessibility Features.

Some keyboard shortcuts can be customized. To manage your keyboard shortcuts, select Optionsthen selectManage keyboard shortcuts. When you enter a new keyboard shortcut, you are prompted to confirm your changes.

Last updated: July 1, 2026