BookmarkSubscribeRSS Feed

Are you ready to venture into programming on SAS Viya?

Started ‎08-03-2022 by
Modified ‎09-07-2022 by
Views 1,018

Because SAS programming in SAS Studio is often the first component of SAS Viya that’s invoked, these steps confirm that analysts have a ‘safe harbor’ from which to start their SAS Viya journey.

 

The attached instructions are for SAS Viya 3.5 and SAS Viya 4 / stable 2022.1.n / Stable 2022.09 / Long-Term Support 2022.09 and later.

 

Italics appear under screen shots as captions. Screen shots’ focal points have pink arrows and circles. 

 

Confirm your URL, login, test

 

  1. Invoke SAS Viya via your organization’s approved web browser(s) and URL – your SAS administrator should know the URL. (It may have qualifiers such as SASLogon/login )
megak8_0-1659553540991.png

If successful, your SAS Drive – Share and Collaborate page will appear as above. If unsuccessful, capture your error message and conduct a web search. Most likely, you’ll collaborate with your SAS Administrator to complete this step.

 

2. Click the drop-down menu megak8_1-1659553616701.png in the upper left hand corner, select Develop SAS Code

megak8_2-1659553616807.png

If successful, your SAS Studio Start Page will appear as below. If unsuccessful, capture your error message and conduct a web search. Most likely, you’ll collaborate with your SAS Administrator to complete this and succeeding steps.

 

megak8_3-1659553616888.png

SAS Studio Start Page

3. In SAS Studio, click the Snippets icon on the left margin megak8_4-1659553683188.png

 

4. Expand SAS Viya Cloud Analytics Services folder

megak8_5-1659553859654.png

 

5. Scroll down then double click on the ‘Generate SAS librefs for caslibs’ then click Run. This step creates the Public library. Review the log to confirm no errors

megak8_6-1659553933120.png

 

6. Click + SAS program to create a new code editor tab. Copy paste the code below into the new tab, then click Run. It will create a new library called sampsio and copy the hmeq dataset from the sample library to the public library, load it into memory and promote it so you can see it in SAS Viya’s other applications (not just SAS Studio).

 

data public.hmeq (promote=yes);
set sampsio.hmeq;
run;

megak8_7-1659553991362.png

You may see an error message such as the one above, indicating that you lack permissions to promote the public caslib. Please discuss with your administrator. When creating tables in CAS from DATA step (or a SAS PROC), the default scope will be session-specific and to change the scope to global, you may need to promote via PROC CASUTIL.

7. Click on the library icon in the left margin megak8_8-1659554053896.png

 

8. Scroll down and click on right arrowhead preceding SAMPSIO to expand that library’s contents

megak8_9-1659554126324.png

 

9. Scroll down, double click HMEQ to ensure you can view it. Close the table viewer by clicking on the X on its tab

 megak8_0-1659559348255.png

 

Congratulations!! You have confirmed that SAS Studio is ready for programming on SAS Viya!

 

Error Handling

Collaborate with your SAS administrator to resolve errors. Conducting web searches on error messages is suggested, as is checking the SAS Environment Manager log.

 

Recommended Viewing and Reading:

Getting the Know SAS Viya

 

Get Started with SAS Studio

Example program for further testing:

proc freq data=sashelp.CARS;
   tables type *  origin; run;

proc means data=sashelp.CARS;
   var msrp invoice; run;

proc print data=sashelp.CARS noobs;
   by make;
  var  model drivetrain cylinders type;
run;

Version history
Last update:
‎09-07-2022 03:45 PM
Updated by:
Contributors

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!

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