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.
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 in the upper left hand corner, select Develop SAS Code
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.
SAS Studio Start Page
3. In SAS Studio, click the Snippets icon on the left margin
4. Expand SAS Viya Cloud Analytics Services folder
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
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;
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
8. Scroll down and click on right arrowhead preceding SAMPSIO to expand that library’s contents
9. Scroll down, double click HMEQ to ensure you can view it. Close the table viewer by clicking on the X on its tab
Collaborate with your SAS administrator to resolve errors. Conducting web searches on error messages is suggested, as is checking the SAS Environment Manager log.
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;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.