SAS Viya 3.5 Quick Start
- About the SAS Viya Programming Documentation
- Orientation
- Load Personal Data
- Provide Shared Data
- Tip: Automatically Connect and Generate Librefs
- References by Task
About the SAS Viya Programming Documentation
This collection of documents provides task-based programming examples, syntax, and concepts for products in SAS Viya, such as:
- SAS Visual Analytics programming
- SAS Visual Statistics programming
- SAS Visual Data Mining and Machine Learning programming
To search this collection, click
. For search tips, click
, and select Help Tips.
Orientation
This software supports analytical data preparation, variable transformations, exploratory analysis, analytical modeling, integrated model comparison, and scoring. Here are the main components of SAS Viya:
| Component | Description |
|---|---|
| SAS 9.4M6 | SAS 9.4M6 is integrated with SAS Viya. SAS programs that are submitted from SAS 9.4M6 clients can call procedures that are unique to SAS Viya, as well as CAS-enabled DATA step code and procedures that have been modified to leverage a CAS server and its tables. |
| SAS Viya | The third generation of high-performance, in-memory analytics. |
| SAS Studio | The integrated SAS programming environment. |
| SAS Cloud Analytic Services (CAS) | The analytic engine. CAS uses high-performance, multithreaded analytic code to rapidly process requests against data of any size. |
| SAS Visual Analytics | Programming tools that provide baseline functionality, including reporting and basic analytics, such as:
|
| SAS Visual Statistics | An additional set of advanced analytic functionality that builds on SAS Visual Analytics, such as:
|
| SAS Visual Data Mining and Machine Learning | An additional set of advanced analytic functionality that builds on SAS Visual Statistics, such as:
|
| SAS Econometrics | A set of functionality that provides techniques to model complex business and economic scenarios and to analyze the dynamic impact that specific events might have over time. |
| SAS Visual Forecasting | Provides automatic variable, event, and model selection. It then automatically generates your forecasts. |
| SAS Visual Text Analytics | A text analytics framework combining text mining, contextual extraction, categorization, sentiment analysis, and search. |
| SAS Optimization | A set of procedures for exploring models of distribution networks, production systems, resource allocation problems, and scheduling problems using the tools of operations research. |
CAS-based procedures run against data that is in CAS. For example, before you can use CAS to work with a SAS data set, you must load that data set into CAS. The following instructions demonstrate the basic mechanics.
Demonstration: Load Personal Data
- Sign in to SAS Studio.
- Open SAS Studio from a URL that is provided by your SAS administrator. For example, you might enter either of the following URLs:
https://webserver-host-name/SASStudioV(for SAS Studio 5.2, which is available in full deployments) - If you are prompted for credentials, sign in.
- Open SAS Studio from a URL that is provided by your SAS administrator. For example, you might enter either of the following URLs:
- Start a CAS session.
- In the Snippets section of the navigation pane, expand Snippets
SAS Viya Cloud Analytic Services. - Right-click New CAS Session and select Open as program. The snippet opens in the code editor.
- In the toolbar, click
to run the New CAS Session code.
- In the Snippets section of the navigation pane, expand Snippets
- Load a table.
- In the navigation pane, right-click Load data to caslib and select Open as program.
- In the code editor, edit the SAS data set section so that it looks like this:
PROC CASUTIL; LOAD DATA=sashelp.cars OUTCASLIB="CASUSER" CASOUT="demoTable" PROMOTE;RUN;TipCASUSER is your personal caslib. It is available across your sessions. You cannot enable other users to access it. - Select the preceding code. In the toolbar, click
to run only the four lines of selected code.
- Verify that you can access the loaded data.
- In the navigation pane, right-click Generate SAS librefs for caslibs and select Open as program.
- In the toolbar, click
to run the code.
- In the Libraries section of the navigation pane, expand Libraries
CASUSER. - Double-click demoTable to open it.
Demonstration: Provide Shared Data
- Sign in to SAS Studio and start a CAS session, if you have not already done so. TipFor details, see the first two steps in the preceding demonstration.
- Create a container for shared CAS data.
- In the Snippets section of the navigation pane, expand Snippets
SAS Viya Cloud Analytic Services. - Right-click New caslib for Path and select Open.
- In the code editor, edit the snippet so that it looks like this:
CASLIB demoCas PATH="/filePath/" DATASOURCE=(SRCTYPE="path") GLOBAL;Note: Enter a path that is relative to and accessible from your CAS server. You can reference an empty directory. - Click
to run the code.
Note: If an error indicates that you do not have permission to create global caslibs, see Caslib Management Privileges in SAS Viya Administration: SAS Cloud Analytic Services. Initially, only administrators can add global caslibs. An administrator can enable non-administrators to add global caslibs.
- In the Snippets section of the navigation pane, expand Snippets
- Give all users Read access to the new caslib.
In the SAS Studio 5.2 Enterprise edition, complete these steps:
- Access the Data page in SAS Environment Manager.
- Select Manage Environment from the applications menu (
) and then click
in the vertical navigation bar.
- Select Manage Environment from the applications menu (
- On the Data page, select the Data Sources tab. Right-click the new caslib, and select Edit authorization. TipData page functionality is also available in other contexts. See Data Selection Windows and SAS Data Explorer in SAS Data Explorer: User’s Guide.
- In the Edit Authorization window, adjust the gauge in the Access Level column to increase access for Authenticated Users from No access to Read.
- Click Save.
- Go back to SAS Studio.
- Select Develop SAS Code from the applications menu (
) .
- Select Develop SAS Code from the applications menu (
- Access the Data page in SAS Environment Manager.
- Load data to the new caslib.
- In the navigation pane of SAS Studio, right-click the snippet Load data to caslib and select Open as program.
- In the code editor, edit the SAS data set section so that it looks like this:
PROC CASUTIL; LOAD DATA=sashelp.cars OUTCASLIB="demoCas" CASOUT="demoTable" PROMOTE;RUN; - Select the preceding code. In the toolbar, click
to run only the four lines of selected code.
- Verify that other users can see the data. For example, ask them to complete these steps:
- Sign in to SAS Studio, start a CAS session, and run the Generate SAS librefs for caslibs snippet.
- In the Libraries section of the navigation pane, expand Libraries
demoCas. - Double-click demoTable to open it.
Tip: Automatically Connect and Generate Librefs
For convenience, you can configure SAS Studio to perform the following tasks each time that you sign in:
- Start a CAS session.
- Generate SAS librefs for existing caslibs that have names that are no more than eight characters long.
Complete the following steps:
- Click Options and select Autoexec file.
- On the Autoexec.sas tab of the (Edit) Autoexec File window, paste the following code:
cas casauto;caslib _all_ assign; - Run the code.
- Save the code.
Documentation: References by Task
| Task | Refer to: |
|---|---|
| Do you need to migrate your data to UTF-8? | |
| Access your data | |
| Manipulate your data | |
| Prepare, Model, Assess | |
| Graph your output data | |
| Program with the Lua, Python, R, or CASL languages | Getting Started with SAS Viya for Lua Getting Started with CASL Programming |
| Learn more about SAS Viya and SAS 9 interactions. |