BookmarkSubscribeRSS Feed

Jobs in SAS® Viya® 4: The Next Generation of Stored Processes Q&A, Slides, and On-Demand Recording

Started ‎04-05-2023 by
Modified ‎04-14-2023 by
Views 982

Watch this Ask the Expert session to learn the similarities and differences to stored processes in SAS 9.4.

 

Watch the Webinar

 

You will learn:

  • About jobs in Viya and their similarities and differences with SAS Stored Processes.
  • How to create a prompt for a SAS job.
  • How to bring existing stored processes to Viya.
  • How to schedule jobs in Viya.

 

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

 

Q&A

Is there going to be any syntactical difference ( %stpbegin..%stpend)  from SAS 9.4 to SAS Viya?

You don't need those. It's still in the code, but you don't need it. They are still in the code but are not necessary for a Viya Job. You probably noticed that when I was using my example here, there's no STPbegin and STPend. By creating a job, you created essentially what's called the “job definition”, which changes that template and changes the icon saying, oh, this is a job. Viya automatically knows it when you bring things over how to create the job and prompts.

 

How to make a stored process run against a pre-assigned library within a SAS stored process server session, are there any concepts in SAS Viya? What is the difference?

Pretty much. I mean the whole thing we were talking about is there's no stored process server that's running in Viya, it runs in SAS Compute. It's essentially running job execution context. As I mentioned before, you can run it under SAS compute, which some people call SPRE (SAS Processing Runtime Engine), or you can run it under CAS as well. There are options as to where it runs. I'm using SAS help libraries, but essentially your libname statements can be set up to point to about any datasource. It's all about where they are on the CAS server or on the Viya server versus where they were, they being the datasets in the stored process or job.

 

How to isolate SAS stored process in several App context server's stored process session? What is the equivalent in SAS Viya?

You can narrow down where it can run the compute context and which server it runs on or let Viya decide.

 

Is the "schedule as a job" option available to any user? Or only users with specific permissions?

It's the latter. Any user can schedule a job. This may be changed in the future to allow an administrator to disable the GUI that creates a job.

 

I see that the "direct execution" URL is using the HTTP protocol. Can we add security around this?

Yes, you can.

 

Currently, we demand people to schedule their batch jobs in the scheduling tool of the organization, where we use a dedicated SAS server. Will Viya/SAS studio allow anyone to schedule jobs on the default SPRE?

Alright, so that's a loaded question. The answer is it depends on how you set it up. But Viya does have some restrictions that you could apply to it if you didn't want to have the people run it. For those that are wondering what SPRE stands for, it’s SAS processing runtime engine, which has been part of SAS Viya for a while. It's essentially what allows you to run SAS 9-like code. I say that because it includes other things too. It has a different name in Viya 202X, more of what we call SAS compute. Yes, you can tell it where to run. There is a little button on that job execution. You can choose which server it runs on and you'll get a pull down. For instance, you could be running things on CAS as well too. I was just really talking about you, although we didn't talk about CAS today. I know it's kind of a wishy-washy answer to say it depends, but you can lock it down and tell them where they can run.

 

Have you a PROC JOB similar to PROC STP in order to run a job from a SAS program?

You saw how I did run it and schedule the job without using the actual prompting framework by just changing the arguments.  I know there isn't something that's literally called proc job, but you reference the job and argument from code. As I mentioned before it, Viya is very much job-centric - just change the value of that parameter on the form and scheduling and run it.

 

Can you share how to schedule a job with prompts (html or task form)?

I think I just showed it before where I was working in there with the job definition itself. I have this job that I created, I could do “schedule job.” It just prompts that same form that you saw beforehand. You can go ahead and make the changes here, including the parameters. There is a method here as well as being able to go to the environment manager or  job execution scheduling as well. We have lots of options but the simplest one for me is to just go ahead from the job itself. This is where you could also change any parameters that need to be changed and save it as part of the job that's going to be submitted.

 

So, it is best to call SAS stored process (SAS 9.4) in SAS Viya as Jobs, that's it? It's the new evolution?

Yes. SAS code is SAS code. Your 9.4 code runs in Viya, and this is just another example of it. It's just a different window dressing to get the same job.

 

I have some questions looking to see on this session maybe: (1) I am looking for is our migration from SAS 9.4 to Viya; (2) when I first heard of SAS Jobs as the next generation of STPs (9.4) - the learning curve of creating an STP via EG seemed to be much simpler for our SAS report developers- mainly they only had to worry about the querying of the data and package that to the STP. It seemed that Viya requires the developer to understand some XML/JSON to package their report as well. Is this still so?

Yes, to a point. Bringing over Stored Processes will automatically create the form, which is a timesaver. We also have lots of examples to get kick started. There are plans to enhance the form development process in future releases of Viya.

 

The main purpose of stored process is to write a common code and put it in metadata, then share them across various user base. How is this going to be stored centrally and managed in SAS Viya? Is there going to be SAS Stored process web application in SAS Viya like in SAS 9.4?

Jobs are almost like for like with what you describe with the difference being there is no SAs 9 style metadata. We do have a couple central applications, Environment Manager and Job Execution framework that do the storage and management. One of the benefits of the HTML and XML style prompt pages is that you can run them from a URL – no Stored Process Web App needed!

 

How SAS stored process Result capabilities (Stream or Package) in SAS Viya like in SAS9.4?

xxx

 

Are Triggers required- for example on a SAS 9.4 SP - the program was run when the user ran it. And (2) since there is now a capability to schedule a program- what are the management tools to manage the scheduling? I like the fact that the capability exists- but I wonder if there is some way to manage in those?

You would use a combination of Environment Manager, SAS Studio and possibly the Jo Execution Framework interface to manage the aspects you mention above.

 

Can you use %include "C:\etc\etc\program_name.sas in Jobs? (FYI: we are currently using SAS 9.4, and Viya for the (near) future.) Our current nightly processes run using a program driver.sas which consist of a list of %incs

Yes, you can! The %include programs must be accessible to the Viya server as well as any attendant programs,

 

In SAS 9.4 via EG, you could associate your prompt values with a metadata SAS dataset. What would be the jobs equivalent?

Dynamic prompts that reference SAS datasets are supported.

 

 

Recommended Resources

SAS Demo | Migration of SAS Stored Processes to SAS Viya Jobs - SAS Video Portal

Migration of Stored Processes to SAS Viya Jobs

Jobs: Stored processes in Viya - SAS Users

Please see additional resources in the attached slide deck.

 

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:
‎04-14-2023 12:41 PM
Updated by:

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 Labels
Article Tags