About DATA Step Scenarios

You might need to create more complex scenarios than is possible via the SAS Visual Investigator scenario design user interface. If you can write SAS DATA step code, you can use the DATA Step Code tab to create more elaborate scenarios.

Here are some examples of situations in which a DATA step scenario might be beneficial:

  • Your scenario logic requires the use of SAS functions that are not supported in a SAS Visual Investigator expression. For example, to produce the desired score value or message text, you need to write more intricate expressions or calculations.
  • Your scenario requires that multiple data sources be used as input data. Though you can assign only one data source to any type of scenario, you can use DATA step code to join tables.
  • Your scenario logic requires multiple passes through the source data. For example, if you want the scenario to compute z-scores.
    Note: For an example of a DATA step scenario that computes z-scores, see DATA Step Code Scenario: Example 1.
  • Your scenario rule message text requires conditional logic. For example, a bank might want to assign scenario-fired event message text that varies based on the time at which a customer accessed an ATM.
Note: For more information about DATA step code, see SAS Cloud Analytic Services: DATA Step Programming.
IMPORTANT SAS Visual Investigator cannot detect all the SAS language elements that are supported for DATA step processing. SAS recommends that you develop your DATA step code in a program such a SAS Studio, and then run it using a PROC CAS statement to ensure that your syntax is compatible with SAS Cloud Analytic Services (CAS).

For more information, see SAS Cloud Analytic Services: DATA Step Programming.

Last updated: June 16, 2026