BookmarkSubscribeRSS Feed

How Can I Run My DATA Step Programs in SAS Viya? Q&A, Slides, and On-Demand Recording

Started ‎08-04-2020 by
Modified ‎08-16-2021 by
Views 4,945

Did you miss the Ask the Expert session on running your DATA Step programs in SAS Viya? Not to worry, you can catch it on-demand at your leisure. 

 

Watch the webinar

 

If you're a longtime SAS programmer, and concerned your skills won’t translate to SAS Viya, don’t worry. You can use all your valuable programming skills in Viya. In fact, this leading-edge software from SAS represents a whole new world to grow your skills and use them for greater contributions to your organization.

During this webinar, you will learn:

  • What Viya is, how it works and what CAS is.
  • How SAS 9 and CAS seamlessly execute SAS programs to prepare and analyze data.
  • What a CASLIB is, how to start a CAS session and how to load data into CAS.
  • How to run DATA step in CAS, run Base SAS Procedures and run CAS enabled procedures.

 

Here are the questions from the Q&A segment held at the end of the webinar. The slides from the webinar are attached.

Will my existing SAS programs run in Viya?

The short answer is YES. Your SAS 9 programs will run as is on Viya assuming that library references, references to include files, etc. are pointing to proper server locations associated with your Viya environment. BUT your programs will not take advantage of Cloud Analytics Services (CAS) in-memory processing until your data is loaded into CASLIBs and you are using DATA Step and cloud enabled PROCS.

 

How do I know what program steps ran in CAS?

Look at the log. If you look at the log and you see “cloud analytics services” then it ran in CAS (it doesn’t shorten it to CAS). If you don’t see that, it didn’t run in CAS. Make sure your procedure is CAS enabled.

 

How do I learn what SAS functions run in CAS?

SAS Documentation. This link is to the list of functions that run in CAS:  https://go.documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.5&docsetId=allprodsle&docsetTarge...

 

Are there any particular procedures or group of procedures that as of now cannot use CAS?

Yes, only SAS 9 procedures that I listed in the presentation are CAS enabled; all others will run on the workspace server (SPRE). Of course, all new procedures that are supplied with Viya products are CAS enabled.

 

How long does the Proc casutil load take to run?

Depends on the size of your data. Typically, it runs very quickly.

 

We saw a nice example of the performance gains we can get using VIYA. Going back to the Cars example demoed, how long did it take to load the Cars table into CAS memory?

The Cars data is tiny, so it loads in a split second.

 

How can I tell if I have access to CAS in my SAS installation?

If you are using EG or SAS Studio you can tell if you have access to CAS if you see any of the tables loaded in memory or if you are able to log on through the log in manager.

 

Is proc sort CAS enabled?

It is not CAS enabled.  Most PROC SORT code can be commented out because the BY statement of DATA Step or CAS enabled procedures will cause sort on the fly. You can also consider simulating the PROC SORT code that contains a NODUPKEY statement with SAS DATA Step.

 

I understand SAS9.4 M6 is the last main official SAS maintenance version. How long will this be supported by SAS? In a few words, when do companies need to move to SAS Viya?

Currently, there are plans to release additional Maintenance releases for SAS9.4, so M6 will be supported for some time depending on how many additional releases come in the future. Companies should move to Viya when they need the functionality that Viya provides.

 

Are SAS Macros enabled in CAS?

Macros are supported in SAS Viya, but only in the SAS session. Macros can be useful in generating the code that runs in CAS, but the macro language itself is not supported in CAS.  https://go.documentation.sas.com/?docsetId=whatsdiff&docsetTarget=n0bwi2f9srst4fn1gek4w7okmaju.htm&d...

 

Is SAS Viya hosted in SAS servers only?

SAS Viya is cloud based, so it can run on public or private clouds. It can also run on SAS Servers.

 

Can you use a lag() function in a SAS Viya CAS data step?

According to the function documentation the LAG() function is a Base SAS function and not CAS enabled. However, that does not mean that you can’t run it in a SAS program that runs in Viya – only that the step with the function will run on the workspace server – not CAS. Keep that in mind because you may want to use this function in preparing your data prior to loading it into CAS.

 

What are some of the major difference between proc SQL and FEDSQL?

The syntax is similar, but there are some SASizms that are not in FEDSQL that you need to watch out for. FEDSQL enables much more transparent access to join multiple tables in multiple formats simultaneously. You can still use proc SQL if you are pulling tables and doing some data prep prior to loading in CAS. Once the table is loaded into CAS, you need to switch over to FEDSQL.

 

Can we get a copy of the FEDSQL knowledge transfer paper?

Here is one good paper:  file:///C:/Users/saswtw/OneDrive%20-%20SAS/Documents/1-SAS/SAS-PRODUCTS/SAS94%20-%20PROC%20SQL%20vs%20PROC%20FEDSQL.pdf . There are other good ones you can find using LexJansen.com search engine.

 

How can CAS do by-group processing without sorting? Is it sorting behind the scenes?

Good question. I assume so, but I would need to check. With by-group processing the data is partitioned by each by-group value to run on a different thread. So, for example, if your environment has 10 available threads, but you assign continent as your by-group and there are only 5 values for continent, your processing will occur on only 5 threads.

 

Is the demo code going to be shared?

Yes, I will change references to sashelp tables so you can run it, and I will post it…

 

I have SAS base 9.4, SAS Enterprise Guide and SAS Studio installed in my PC. Is SAS Viya one of the SAS Base, Enterprise Guide, SAS STUDIO features or it is a software that is different from other SAS software above?

You are currently running a SAS 9.4 environment on your PC. That is great. SAS Viya is a whole different environment to address specific use cases. It has a different architecture. If your organization does license SAS Viya and it is configured so that SAS 9 and SAS Viya can work together, you could theoretically write your SAS programs in Enterprise Guide on your PC that include CAS enabled steps that could be submitted to the CAS server.

 

If a proc or function is not CAS enabled, then do you need SAS 9.4 or Enterprise Guide to run? Will SAS Studio work? (Our agency is thinking of going from PC SAS 9.4 to either 9.4 server or Studio. They are gathering info now to make best choice. They will be considering Viya options as well.)

No. In Viya, anything that is not CAS enabled will run on SPRE (the equivalent of the SAS 9 Workspace server in SAS9). It does not matter what user interface you are using – EG or SAS Studio. See above for link to CAS enabled functions. Here is link to CAS enabled procedures:  https://go.documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.5&docsetId=proc&docsetTarget=p0nn...

 

What is a federated join?

Here is a great paper on the topic:  https://support.sas.com/resources/papers/proceedings15/3390-2015.pdf

 

Can SAS Viya run on mainframes?

No. Viya runs on Linux and Windows operating systems only and in various public and private cloud deployments.

 

Does CAS work the same with ODS files using Excel? I know you gave example of Excel.

Viya does. When ODS is involved, the processing step runs not in CAS but on the workspace server (SPRE) as there is no advantage for using distributed in memory-processing for this type of work.

 

My org doesn't currently have SAS Viya, but we have server SAS and use Studio, Enterprise Miner, Enterprise Guide, and Contextual Analysis. We were told Contextual Analysis support is ending and that we would be switched to Visual Text Analytics which requires Viya. Does this mean everything else will need to be converted to run on Viya and we will be on CAS? I'm ignorant about CAS/Viya/Server/Admin info, but an analyst with tons of programs that I'm not sure if I need to start preparing to convert.
That is a good and big question. In migrating to Viya there are many options and considerations (more than I can address here or am qualified to address). Your organization could acquire Viya for VTA but still run legacy programs in SAS 9. You as a SAS programmer could take advantage of that by modifying your long running, CPU intensive SAS 9 program steps to run in CAS without needing to change your entire program. The other steps will still run on SAS 9.

 

Can you save output to a local directory using the ODS system with Viya?

Yes, you can.

 

Recommended Resources

SAS® Viya® Enablement

Programming for SAS® Viya®

An Introduction to SAS® Viya® 3.5 Programming

 

Want more tips? Be sure to subscribe to the Ask the Expert board to receive follow up Q&A, slides and recordings from other SAS Ask the Expert webinars.  

 

Version history
Last update:
‎08-16-2021 03:31 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!

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Article Tags