Quite often as when working with one of the SAS Risk Solutions, we are required to work with preloaded job flows that are surfaced in the respective solution’s UI. There is an infinite desire to learn how are the diagrammatic representations of job flows are created, and how the nodes in a job flow magically perform all the calculations. This is a post that helps explain SAS Infrastructure for Risk Management (IRM) job flows.
In SAS IRM, we use Business Process Modeling Notation (BPMN) to construct the job flows. It is a common notation for defining executable business process diagrams. SAS IRM uses a small subset of BPMN to create job flows. A diagram view of a typical job flow in SAS IRM looks like:
Job flows are graphical representations of a sequence of calculation steps. Some job flows contain tasks that are also complete job flows themselves – these are called subflows (we will not be talking about subflows in this post).
Nodes or tasks are the basic building blocks of SAS IRM. A task requires defined input and/or output objects. Input data objects are displayed above the task and these are connected with an arrow pointing to the task. Output data objects are displayed below the task with arrows leading away from the task.
Job flow definitions in SAS IRM can be created in two ways. The first method involves using the scripting client in SAS IRM – this is the recommended method. The second method involves using a macro enabled MS Excel file – this is a method used mostly for learning purposes.
With the scripting client, the SAS IRM leverages several types of macros (both foundational and SAS IRM specific macros) to automatically create the job flows and surface them in the SAS IRM UI. This method completely shields us from the background activities related to job flow creation, registering of job flows in SAS IRM, mapping the appropriate federated area with a job flow, etc.
On the other, using a macro-enable Excel file for creating BPMN job flows we can learn each one of these steps individually. The macro-enable Excel file called BPMN Generator.xlsm is usually shipped with all SAS risk solutions. It can be found in the tools folder in the registered federated areas.
A federated area is a folder structure that conforms to specific SAS IRM rules. It is a storage area for content, and it is the mechanism by which developers add custom content to SAS IRM. By default, SAS IRM provides a platform federated area and a sample federated area. The sample federated area is what we will use for creating our job flows.
The relevant federated area folders for creating a job flow using BPMN Generator.xlsm file is:
The job flow that we are attempting to create here consists of two different tasks that will ultimately calculate the net present value (NPV) of a future stream of values. The two tasks are:
To create the job flow described above we will first create it outside of SAS IRM and then copy it into SAS IRM (we want to rule out the possibility of crashing the entire SAS IRM server in case something goes wrong while creating the BPMN file).
data tmp.cashflows;
set staging.cashflows;
run;
data tmp.dis_cashflows; set tmp.cashflows; NPV_AMT=exp(-Discount_Rate * TimeToExpiration) * FACE_VALUE_AMT; run;
For better visibility the information from the screen shot above is presented in tabular form below:
demo,demo_jobflow,both,sample_36_configuration
demo_jobflow.bpmn=Demo Job Flow for Discounting Cash Flows
#Labels for TMP TMP.cashflows=Copy of fact table for cash flows TMP.dis_cashflows=Discounted fact table for cash flows
For a more in-depth training on SAS IRM refer to the course SAS Infrastructure for Risk Management Overview.
Hi @SoumitraDas ,
Thanks for the guide that is really simple to read and got it.
I need an help for a task. I have to add an input tables in a Sas nodes but I really don't understand how can I add a simple table from a libraries in the /param_in.
Do I need to change the .bmpn
file? What is the best and simplest option?
Thanks
Hi @Balda981, if you plan to use this method (BPMN Generator) then it is a matter of replicating the entries for specifying an input data (as shown in the relevant screenshot above) using the three-part nomenclature (LIBRARY.DATASET-NAME.DATASET-EXTENSION) in the BPMN Generator file to modify resultant BPMN file - otherwise the input data will not show up in the diagrammatic representation of the modified job flow.
You will also need to create/modify the SAS code that is working behind the relevant task/node in the job-flow to specify your data, say for example, in a SAS DATA step so that when the code executes it will pick up your data file as the input data.
What is important to bear in mind is that whenever we specify a library in SAS IRM (in this case the relevant library is located at /param_in) it should be first specified the LIBNAMES.TXT file (located in the CONFIG folder of the federated area you are working on) for SAS IRM to recognize it. In the example that I showed above, there was no need to do this because the STAGING library was already defined in the LIBNAMES.TXT file, while TMP was a SAS system defined library pointing to the TMP folder in the operating system.
Please note, as I already pointed out in the writeup, the BPMN generator is not the recommended method for creating job-flows in SAS IRM - the SAS scripting client is the recommended method. Thanks.
Hi @SoumitraDas ,
Unfortunately I still can't insert a new table at the desired node.
I have an already developed SAS IRM solution, with the jobflows already integrated and arranged and I would like to add and map a new library to these to obtain a new table to use within the code.
I tried as you suggested to insert the library into the libnames.txt in this way (RRM_LAN=%la/%bd/%et/airb) and then to place the param_in file in the node ( \param [in] %in_gestionale= rrm_lan.gestionale.sas7bdat : test). But when I run it, it breaks the engine because, ERROR: Libref RRM_LAN is not assigned..
I would need to understand how to recover that necessary table within the node and above all how it can be done on an already existing solution, without creating new tasks. I read in the guides that perhaps Doxygen is needed, but how is it used? Works?
Hi @Balda981,
The error message is indicating that the RRM_LAN library is not assigned. This is most likely a problem with the path "%la/%bd/%et/airb" defined for the libref. One problem could be related to the "%et" parameter which resolves to the entity selected when creating the job flow. For using "%et", the name of the entity folder must be the lowercase value of the ENTITY_ID. Usually, the entity folders contain multiple base date folders as each entity could be run for multiple time periods. But, in your case this seems to be the other way around - your entity folder is defined within the base date folder (%la/%bd/%et/airb).
There could be several other reasons that could cause a failure to assign the required library like the libref in question may have been defined for a lower federated area and not in a higher federated area, and so on.
Your issue seems quite technical and requires more information to come up with a resolution. I recommend reaching out to the SAS technical support team or the SAS implementation team at your site for more specialized assistance.
Thanks
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.