If you are unfamiliar with Jobs in SAS Viya then check out Gerry Nelson’s article: Jobs: Stored processes in Viya.
Essentially it’s the new way to submit code to be processed by one of SAS’ analytic engines. There many use cases that can be solved using Viya Jobs, here are a few articles that cover a variety of examples:
This article will cover the three ways you can include a Job in a SAS Visual Analytics report: Job Content object, Web Content object or Data-Driven Content object.
The Viya Job I will be using for this article is a vanilla flavored, no frills job. This means that this job isn’t surfacing any fancy custom web application code or model scoring in the background.
The example job makes use of the SASHELP.CARS data source and uses XML to build the Task prompts. There are two prompts: one for Make and one for Type and the results are streamed using the _output_type of ods_html5.
Could the below behavior be modified for a more seamless integration of the Viya Job, absolutely. Take a look at the examples listed at the top or bottom of this article for more in-depth examples.
Introduced in the April stable release of SAS Viya (2020.1.5) is the Job Content object that will display the output from SAS Viya Jobs.
Adding the object to the report canvas and navigating to your desired Job is straight forward.
Use the Object pane and add the Job content object to the report.
Next, use either the Select a job. button from the object or the Browse button from the Options pane to navigate to the desired Viya Job.
In this example, the Viya Job has default values assigned to the two prompts which are used for the initial execution. The results are displayed in SAS VA report in the Job content object.
Use the object’s overflow menu and select Set job parameters… to bring up the dialogue to select different prompt values. When you click Close the job is executed.
Configuration tip: To ensure the best performance, adjust the minimum number of SAS Compute servers available to your environment. This will save time so that when the SAS VA report is opened and the Viya Job needs to execute, time is not spent waiting for a SAS Compute server to be spun up. See the SAS Viya Administration Documentation under Configure a Pool of Available Servers.
The second way you can show results of a Viya Job in a SAS VA report is using the Web content object.
Once the object is added to the VA report, use the Options pane and replace the default URL value with your SAS Viya Job URL.
You can get the Viya Job URL from SAS Studio’s Properties pane.
You can see that using the Web content object displays the Job’s prompt form in the VA report window. After you make your selections, the default values are pre-populated here, the results open in a new browser window.
If you see this error: Popups must be enabled
Then follow the instructions for adding the allow-popups to the sas.visualanalytics IFrame Sandbox Attribute Value property as described under the SAS Visual Analytics Documentation: Configuration Properties for SAS Visual Analytics. This note is also mentioned under the Working with Job Content.
Remember you could code a more custom web application that surfaces an HTML form with both the prompts and Job results in the same window. For more examples, take a look at Mike's articles mentioned earlier:
For this object, when using a "typical" Viya Job, it behaves like the Web Content object. That is once you define the URL Option property the results will open in a new tab.
The one main difference is that the Data-driven content object requires a Role assignment.
The true power behind the Data-driven content object is that you can essentially surface a custom web application and as many of our dedicated coders know, this can be achieved through a Viya Job. Take a look at some of Xavier’s articles mentioned earlier for integrating both Viya Jobs and the Data-driven content object.
Let’s outline the important takeaways for our options for executing Viya Jobs in a SAS VA report:
Regardless of the object you use to display the results of your Viya Job, be sure to get the most from your environment by making sure these configurations are set:
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.