BookmarkSubscribeRSS Feed

Quick Guide to Using SAS® Stored Processes in SAS® Visual Analytics*

Started ‎11-05-2015 by
Modified ‎11-05-2015 by
Views 9,915

 

A stored process is a SAS program that is defined in metadata and stored either on a server or in metadata.

 

You can create a stored process by manually writing code in a Base SAS® session and then using SAS® Management Console to register that code in metadata. At the time of registration, you can point to a physical location for the code (a .sas file), or you can store the code in metadata. Instructions for writing and registering the stored process are in the SAS® Stored Processes: Developer's Guide. 

 

You also can use SAS® Enterprise Guide® to create a stored process from a task or a process flow. When you are satisfied with the results, you can right-click on the process flow or task and select Create Stored Process.  The Create Stored Process wizard adds the required syntax and registers the stored process in metadata.

 

Considerations Specific to SAS Visual Analytics

Here are some things to keep in mind about executing stored processes in SAS Visual Analytics:

 

  • Stored processes can use any available data source (not only LASR tables). However, running stored processes against large LASR tables is not a high-performance operation. Any referenced LASR tables must be read from the SAS® LASR™ Analytic Server into a SAS session in the execution server. In other words, you do not achieve any performance benefit from using LASR tables as input to your stored processes.

 

  • Most SAS procedures are available to only sites that license additional software (such as Base SAS). For a site that licenses only SAS Visual Analytics, most stored processes do not run.

 

  • The primary reason for running stored processes in SAS Visual Analytics should be to produce report output. If your stored process does not produce report output, then use a tool that is designed specifically to execute stored processes. For example, the SAS® Stored Process Web Application is designed specifically to run stored processes on the web.

 

Required Permissions

The topic “Working with Stored Processes” in Permissions by Task (SAS® Intelligence Platform: Security Administration Guide) lists the metadata permissions that are required for the account under which the stored process is executing.

 

  • If you chose to execute the stored process on the SAS® Stored Process Server, then the account is typically the launch credentials for that server.

 

  • If you chose to execute the stored process on the workspace server, then the requesting user (i.e., the logged in user) must have the required permissions.

 

  • If you chose to allow the client application to determine the execution server, then typically the stored process server is used.

If you chose to store the code in a .sas file, then the launch credentials or the requesting user must also have Read and Write access to the physical location of the code.

 

Using a Stored Process in a Report

You can use SAS® Visual Analytics Designer to create a report that includes a stored process. To add the stored process to a report, drag a Stored Process object (located beneath Other on the Objects tab) onto the report canvas. In the Open dialog box, navigate to the metadata folder that contains the registration for the stored process. Select the stored process, and then click Open to render the results.

 

Here are some tips for creating a report that includes a stored process:

 

  • You cannot add a stored process to a report if the precision layout view is selected. If the report already contains a stored process, then the stored process is removed if you change to precision layout.

 

  • A stored process cannot be the source or target of an interaction in a report. However, you can use the Report Linking feature to create an external link from a report object to a stored process. The designer automatically generates the URL for you. You simply click the Link to Stored Process button in the External Link dialog box and navigate to the stored process that you want to use.

 

  • You cannot add a stored process to a container.

 

  • Prompted stored processes behave differently depending on the mode (classic or modern), whether the prompts are required, and whether the prompts have default values. For details, see How Designer, Web Viewer, and the Home Page Handle Prompted Stored Processes at the end of this article.

 

  • The stored process output in a report is rendered as HTML regardless of the output type that is specified in the stored process code.

 

  • Selecting the Show SAS log in the output option on the Properties tab for the stored process enables you to see both the log output and the stored process output in the report. The log appears beneath the output.

 

Opening a Stored Process from the Home Page, the Web Viewer, and SAS® Mobile BI

Here are some tips about opening stored processes, depending on the client:

 

  • From the home page or the web viewer, you can open a report that includes a stored process, or you can open a stored process directly. From SAS Mobile BI, you can open stored processes only if they are included in a report.

 

  • When you open a stored process from the home page, results open in the web viewer. Reports that include stored processes can be opened either in the designer or the web viewer.

 

  • When a report that contains a prompted stored process is opened in the web viewer or SAS Mobile BI, the output is rendered using the values that were saved with the report. SAS Mobile BI and the modern version of the web viewer do not enable you to change prompt values. If you are using the classic web viewer and the ability to select values in the web viewer is enabled, then you can click exactly at the top border of the output in order to display a ? icon. Click the icon to select different prompt values.

 

  • When you open a prompted stored process directly--either into the designer, from the hub, or in the web viewer--the prompt behavior depends on the mode (classic or modern), whether the prompts are required, and whether the prompts have default values. For details, see the next section.

 

How Designer, Web Viewer, and the Home Page Handle Prompted Stored Processes

The following table describes how prompted stored processes are handled when they are added to a report in the designer, and when they are opened directly in the web viewer and from the home page. The behavior depends on the mode (classic or modern), whether the prompts are required, and whether the prompts have default values.

 

Required

Default Values

Designer

Home Page and Web Viewer (classic)

Home Page and Web Viewer (modern)

Yes

Yes

Renders with default values. Click the Edit Prompts button on the Properties tab to select different values.

Prompts are displayed. You must confirm the current values or select new values.

Renders with default values. You cannot change the values.

Yes

No

Empty prompts are displayed. Click the Edit Prompts button on the Properties tab to select prompt values.

Empty prompts are displayed. You must select values to render results.

An error appears because the prompts are required but you are not allowed to select prompt values. The stored process cannot be executed.

No

Yes

Renders with default values. Click the Edit Prompts button on the Properties tab to select different values.

Prompts are displayed. You must confirm the current values or select new values.

Renders with default values. You cannot change the values.

No

No

A blank page appears. Click the Edit Prompts button on the Properties tab to select prompt values.

Empty prompts are displayed. You must select values to render results.

A blank page appears because there are no default values. You cannot select values, so the stored process cannot be executed.

 

Additional Information

For more information about how the individual SAS Visual Analytics clients use stored processes, see the SAS® Visual Analytics User’s Guide for your release of SAS. There are prerequisites for printing stored processes, which are explained in the User’s Guide.

 

In addition, here is a list of related SAS notes:

Usage Note 50406: Sample stored processes might not render results in SAS® Visual Analytics

Usage Note 50399: In SAS® Visual Analytics, SAS® Stored Process output might display outside of the ...

Usage Note 56401: In SAS® Visual Analytics Viewer, stored process output might temporarily disappear

Usage Note 48498: Adding a comment to a stored process in SAS® Visual Analytics Viewer

Usage Note 53915: Preventing access to specific SAS® object types from the SAS® Visual Analytics hom...

Usage Note 50625: In SAS® Visual Analytics Designer, SAS® Stored Processes are not supported in a pr...

Usage Note 48505: Performing actions on a stored process that is contained in a report in SAS® Visua...

Problem Note 56835: In SAS® Visual Analytics Designer, the Edit External Link dialog box might not d...

 

-----------------------------------

*This article applies to releases 7.1, 7.2, and 7.3.

Comments

A fantastic and resourceful guide for those that are looking to use SAS Stored Processes with SAS Visual Analytics! Thanks @Madelyn_SAS. I look forward to share this. 😀

Do we need SAS EBI + SAS VA , if we are including them as part of a SAS VA Report.  if  yes , is it safe to assume that processing will always go to the SAS STP server , and not the workspace server.

You do not have to license EBI in order to use SAS Visual Analytics to display stored process output. However, a SAS Visual Analytics license has limited access to Base SAS and SAS/GRAPH procedures, so some of your stored processes might not run. The execution server depends on which server you selected when you registered the stored process in SAS Management Console. You can explicitly select to use the SAS Stored Process Server.

I need to do more reading on what I can do with Stored Processes.  Maybe it's a way to resolve some limitations of paramater passing in VA.

 

Great concise article. 

 

Thank you.

 

Version history
Last update:
‎11-05-2015 03:23 PM
Updated by:
Contributors

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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