BookmarkSubscribeRSS Feed

Cycles in Batch Mode in SAS Risk Stratum

Started a week ago by
Modified a week ago by
Views 267

Introduction

 

Developers and testers associated with SAS solutions which are based on SAS Risk Stratum can leverage the batch run facility. A batch run macro execution service streamlines testing for developers and consultants by eliminating the need to navigate the UI manually. It allows you to execute a Risk Governance Framework cycle—either fully or partially—in batch mode. By predefining all parameters and workflow choices in an Excel document, you can run the entire cycle with a single click, avoiding repetitive task-by-task execution and waiting for system responses. This article presents an overview of using batch run facility for cycle execution in SAS Risk Governance Framework. It assumes that readers are proficient in SAS programming and have basic knowledge of SAS Risk Governance Framework.

 

 

You can obtain more information on

SAS Risk Governance Framework and

SAS Risk Stratum

using the following training programs.

 

SAS Risk Governance Framework Solution Overview

 

Data Preparation, Configuration, and Administration in SAS Risk Stratum 

 

Batch Service Options

 

Following three options are available:

 

  • Execute a complete cycle
  • Creating a new cycle
  • Run a Cycle task

 

In this article we shall focus on executing a complete cycle using a program, batch_run_sample_cycle.sas, shipped with SAS Risk Governance Framework. The program is in the batch execution folder in the federated area.

 

 

01_SB_B11P1-1024x359.png

 Illustration of sample codes in Batch Execution folder in a federated area.

 

Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.

 

A typical location is as follows:

 

<SAS Repository>\SASIRM\fa.rmc.yyyy.mm\rgf\sas\batch_execution (yyyy.mm represent year and month of your current version)

 

The code comes along with an excel file template, sample_cycle_param_table.xlsx, for storing tasks related parameters for your cycle.

 

Using the batch code

 

There are four major steps for using the batch code as the following:

 

02_SB_B11P8-1024x254.png

Simple illustration of steps for batch execution

 

Supply Macro Parameters

 

Open the script batch_run_sample_cycle.sas in Base SAS or SAS Studio. After making changes, you must save it with a different name and preserve the original copy of the code. The script for the batch mode runs several macros. You must provide the following parameters for the successful execution of the script. Following is a brief description of the parameters:

 

Parameter Description Sample Values
Host SAS Risk Governance Framework host sas-aap.demo.sas.com, sasbap.demo.sas.com
Port SAS Risk Governance Framework port 80
Server SAS Risk Governance Framework server SAS Risk Governance Framework (Default value)
Solution SAS Risk Governance Framework content id rmc.2023.03 or rmc.* to pick up the latest version of rmc
Username Username (must have necessary RGF access to run through the cycle) sasdemo, rgfadmin (Any user with the RGF: Administration role)
Password Password for the user Password of the user
Solution_version Version of the solution content  icv.v09.2023, cecl.2022.02
Stratum_version Version of the Stratum core rmc.2023.03 or rmc.* to pick up the latest version of rmc)
Scenario_file_path Path to the scenario files (if loading scenarios via this script) D:\scenarios.xlsx
Prespective Perspective id (valid id value for solutionCreatedin parameter) Sampl,icv,ifrs9,ldti
Param_table_path Path to the file containing the parameters for batch execution D:\
Param_table_name Name of the file containing the parameters for batch execution Param_table.xlsx
Log_level Debug logging level 1-5, 1 being the least amount of logging and 5 being the most, defaults to 1

 

Following is a depiction of supplied values:

 

03_SB_B11P3-1024x541.png

Illustration of supplied parameters in the script.

 

Supply Cycle Parameters

 

Your cycle tasks need several parameters depending on the tasks involved in the cycle. You must provide each of these parameters for each of the tasks in a predefined template. Following are the steps you should follow:

 

Copy the File

 

  • Navigate to the repository: \<repository>\rgf\sas\batch_execution.
  • Locate the file: sample_cycle_param_table.xlsx.
  • Make a copy of this file to a local folder of your choice. (Example: D:\)
  • You can rename this copy as required (Example: param_table.xlsx) Note: Do not modify the sheet names in the file.

 

Edit the Cycles sheet

 

  • Open the copied file using Excel.
  • Navigate to the Cycles sheet.
  • Specify the details of the cycles you want to create, such as:

 

  • Cycle Name
  • Cycle Id
  • Cycle base date
  • Additional cycle configuration parameters (if any).

 

04_SB_B11P4-1024x182.png

Illustration of Cycles sheet.

 

Note that there are several columns that you can configure. The Cycles sheet in the parameter table defines various cycle configurations for execution. Each cycle is uniquely identified by a cycle_id (e.g., RMC Test Batch01) and is accompanied by a descriptive cycle_name and optional cycle_description to provide context. Column A determines whether the cycle is executed; leaving it blank allows the batch program to process the cycle, while adding a # ignores it. The cycle_base_dt specifies the base date for the cycle in yyyy-mm-dd format, and the entity_id associates the cycle with a valid entity ID linked to the data for that base date. The initial_run_flg indicates whether the cycle is an initial run, defaulting to Y (yes) if left blank, while subsequent runs should be marked as N. The workflow_template_id identifies the workflow template to be used, and the optional dimensional_points field can be left blank to default to the solution perspective (e.g., rmc) or filled with comma-separated values for customized dimensions. The control_framework_id links the cycle to a specific control framework, and the func_currency defines the functional currency for monetary value conversion (e.g., USD, EUR). Together, these fields ensure that cycles are properly configured for batch execution, with flexibility for customization where needed.

 

Edit the Workflow sheet

  • Navigate to the Workflow sheet.
  • Define the cycle-task combinations for execution:

 

  • Cycle Name: Match it with a cycle defined in the Cycles sheet.
  • Task Name: List the task(s) to be executed as part of the cycle.
  • Specify other task-related parameters or dependencies, if required.

 

05_SB_B11P5-1024x314.png

Illustration of Workflow sheet.

 

The Workflow sheet contains additional parameters to define tasks and their behavior within a cycle. The task_for_parameters field specifies the parameters to be applied for a particular task, ensuring accurate task execution. The activity_choice parameter offers options for user actions in a task sub-flow, while transition_choice outlines the necessary steps for advancing to the next task in the workflow. The analysisRunTitle allows for customized naming of an analysis run, but if left empty, a default naming convention is applied. The waitFlg reads the wait flag parameter, determining any delays or conditions before proceeding. The create_link_instances field enables linking objects, such as analysis data from previous runs, with an example format like {cycle_analysisData_prev_1=""and(eq(baseDate,2018-12-31),eq(solutionCreatedIn,'CECL'),eq(resultsCategoryCd,'FR_HTM'))""}. Finally, the control_param_lookup_key is used to define specific parameters for the control framework, allowing for tailored execution and validation. These fields collectively provide detailed control over the task execution process within the workflow.

 

Edit the Param_table sheet

To manage task parameters, navigate to the param_table tab, which includes key fields for defining and organizing parameters.

 

06_SB_B11P6-1024x536.png

Illustration of Param_table sheet.

 

The name column specifies the parameter associated with the model required for the task, uniquely identifying it within the model's context. The task column links the parameter to a task, as defined in the task_for_parameters field in the workflows, while the value column assigns the parameter's value, which may be numeric, textual, or conditional, depending on its purpose. For tasks involving nested parameters or hierarchical structures, the parent column identifies the parent parameter, ensuring logical organization. The filter field is particularly useful when assigning a value to a model parameter that references a custom object instance with an unknown instance key, as it enables the use of dynamic conditions to identify the instance. Filter values must align with the value column and the base date choice for accuracy. Additionally, the OUTANLYSISDATANAME parameter should adhere to the site's naming conventions to maintain consistency and clarity in data references, ensuring that parameters are accurately linked to custom objects even when exact identifiers are not available.

 

Note that with in this context of article no scenarios are used. So the Scenarios sheet is empty and not discussed here.  The control_param_table sheet is similar to param_table sheet. It contains parameter for the control framework if it is used in the cycle. It might be optional in many cases.

 

Save Your Changes

After editing relevant sheets, save the file in a different location. For example, D:\param_table.xlsx.

 

Ready for Execution

Use the updated file to execute cycles and workflows as per your system's batch execution process.

 

Execute the Code

 

The code once ready can be easily run in Base SAS or SAS Studio.

 

Click the Submit icon to execute it. Note that the total execution of the script depends on several factors like size of the data, number of tasks in the cycle, complexity of the tasks, computational requirements, hardware configuration and so on.

 

Validate the Cycle

 

Log in into the solution. On the Cycles workspace, verify that your batch cycle exists with Cycle Status of Completed.

 

07_SB_B11P7-1024x418.png

Illustration of a batch executed cycle. 

 

You can click on a cycle to access related workspaces or reports, allowing you to verify that the cycle's results are logical and valid. This provides a convenient way to cross-check outputs and ensure accuracy across associated tasks and data.

 

Conclusion

 

The batch run feature in SAS Risk Stratum simplifies the development and testing process for implementors. It leverages a macro execution service that enables users to execute Risk Governance Framework cycles in batch mode by utilizing predefined parameters from an Excel file. With just one click, this functionality removes the reliance on manual UI interactions and minimizes repetitive tasks. This enhances efficiency and ensures a more seamless  experience, making it an invaluable tool.

 

For more information on SAS Risk Stratum and related topics, refer to the following documentation

 

SAS Risk Stratum Cookbook

 

 

Find more articles from SAS Global Enablement and Learning here.

Version history
Last update:
a week ago
Updated by:
Contributors

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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