Example: Creating a Custom Graph That Uses a Stored Process

Overview

This example describes how to create a stored process and a custom graph indicator that uses the stored process. By using a stored process, you can create dashboards that display images created by using SAS/GRAPH.
For more information, see Custom Graph.

Create the Stored Process

When you create the stored process, it must meet the following requirements:
  • create an image file in one of the following formats: PNG, JPG, and GIF (but not animated GIF).
  • use streaming output.
  • write directly to _WEBOUT.
  • not include the %STPBEGIN and %STPEND macros.
  • not produce HTML output. SAS BI Dashboard does not support the display of HTML content.
The stored process that you want to use must include GOPTIONS statements to direct the output to an image file through the special fileref _WEBOUT. Add the following code at the beginning of the SAS/GRAPH code that creates the image:
goptions gsfname=_webout gsfmode=replace;
goptions device=png;
Note: The device setting must be GIF, JPG, or PNG.
Be sure to use the following settings in SAS Enterprise Guide:
  • Turn off stored process macros.
    In the Stored Process Manager window, view the SAS Code pane. Turn off stored process macros by clicking Include code for and clearing the Stored process macros selection. The following message appears:
    The append macros setting is disabled and the SAS code does not 
    contain the %stpbegin and %stpend macros.  
    Would you like to turn on the append macros setting?"
    Click No to dismiss the message.
  • Specify the stored process server.
    In the Stored Process Manager window, view the Execution Options pane. In the Execution server field, select SASApp — Logical Stored Process Server and specify the location of the Stored Process server.
  • Set the result type to streaming.
    In the Stored Process Manager window, view the Execution Options pane. In the SAS Result Types this Stored Process can Support are, select Streaming.
Run the stored process to make sure the output file is created. It is also a best practice that detects whether your operating system permissions are adequate.
When the stored process is created successfully, complete the following steps to copy the Web address that executes the stored process:
  1. Open the Stored Process Web application.
  2. Click List Available Stored Processes.
  3. Locate the stored process that you created and click to open it.
  4. Right-click the stored process image in the right pane and select Properties.
  5. In the Properties window, select and copy the Web address from the Address (URL) field.
    Note: In some Web browsers, you might have to scroll down while you select the Web address in order to copy the entire Web address.

Create the Custom Graph Indicator

To create a custom graph indicator for use in a dashboard, complete the following steps in the SAS BI Dashboard designer:
  1. Create a new indicator and from the Display type list, select Custom Graph. For detailed steps, see Create an Indicator.
    Note: The custom graph indicator does not require that you select indicator data or a range.
  2. In the open indicator, view the Properties pane. In the Display Settings section, in the Image Web address field, paste the stored process Web address that you copied from the Stored Process Web application.
    Note: This field does not support relative pathnames. If you import or export the custom graph indicator as part of a package, you must update the path in this field.
    For more information, see Create the Stored Process.
  3. If the stored process image is accessed from another domain, select Use proxy.
  4. Click Save icon to save the custom graph indicator.
The custom graph is now available for use in a dashboard. For more information about creating a dashboard, see Laying Out Content in a Dashboard.
Tip
  • When you add the custom graph indicator to a dashboard, if the custom graph is a complex image, consider enabling the zoom feature for the indicator. The custom graph indicator can appear small in the dashboard, but the user can zoom in on the image to view its detail easily. For more information, see Enabling Zoom for an Indicator or Static Content.
  • Test the custom graph in the dashboard by using the preview feature. For more information, see Test a Dashboard by Using Preview Dashboard.