SAS Documentation
SASĀ® Solution for Stress Testing
Reference manual - version 08.2021
Loading...
Searching...
No Matches
irmst_model_precode_ccar_measures.sas
1/* ******************************************** *
2/* Pre-processing script for the MIP execution *
3/* ******************************************** *
4
5Details:
6 The following SAS macro variables are available to the model at run time:
7 - ticket: SAS authentication service ticket (useful for performing operations that require authentication, i.e. interacting with REST services).
8 - rgf_protocol: Communication protocol (http/https) of the SAS Risk and Governance Framework web application
9 - rgf_host: Hostname of the SAS Risk and Governance Framework web application
10 - rgf_port: Port where the SAS Risk and Governance Framework web application is listening
11 - rgf_service: The service where the SAS Risk and Governance Framework web application is listening
12 - ds_in_portfolio: portfolio table
13 - ds_in_scenario: scenario table
14 - ds_in_counterparty: counterparty table (if used)
15 - ds_in_mitigant: credit risk mitigant table (if used)
16 The following libraries are pre assigned:
17 - mipport: MIP portfolio library
18 - mipcpty: MIP counterparty library
19 - mipmit: MIP credit risk mitigant library
20 - mipcf: MIP cashflow library
21 - mippmx: MIP parameter matrix library
22 - mipval: MIP valueData library
23 - mipfunc: MIP functions library
24*/
25
26/*It determines which information should be extracted from the simstat tables (These are MIP output tables.)*/
27%let mipQueryFilter=find(upcase(scenario), ":BASECASE") eq 0;
28
29/* Prevents RMC run model from making duplicate queries */
30%if (&dma_expansion_flg. eq Y) %then %do;
31 %let mipQueryFlg = N;
32%end;
33
34/* Prepare RiskDataMaps parameters for the MIP execution
35 Syntax: <Risk Data Object Name>:<Libname.Dataset> [, <Risk Data Object Name>:<Libname.Dataset>] */
36%let mipParameterMatrices = %quote(tm_pmx : mippmx.tm_pmx_&base_dt_ymdn._&model_run_key. ,
37 pd_pmx : mippmx.pd_pmx_&base_dt_ymdn._&model_run_key. ,
38 lgd_risk_index_pmx : mippmx.lgd_risk_index_pmx_&model_run_key.);
39
40/* Retrieve TM Result Analysis Data using TM_RESULTS_KEY that is dynamically stored in credit_risk_config table */
41%irmst_get_tm_analysis_data(ad_libref = &dr_libref.
42 , debug = false
43 , in_tm_analysis_data_key = &tm_results_key.
44 , out_tm_set = work.tm_set
45 , rgf_host = &rgf_host.
46 , rgf_port = &rgf_port.
47 , rgf_protocol = &rgf_protocol.
48 , rgf_service = &rgf_service.
49 , rgf_solution = &rgf_solution.
50 , tgt_ticket = %superq(tgt_ticket)
51 )
52
53/*---------------------------
54 * PMX Configuration Process
55 *---------------------------*/
56%irmst_create_ctm_pmx(input_tm_set = work.tm_set
57 , output_pmx = mippmx.tm_pmx_&base_dt_ymdn._&model_run_key.
58 , debug = FALSE
59 );
60
61%irmst_create_pd_pmx(input_tm_set = work.tm_set
62 , output_pmx = mippmx.pd_pmx_&base_dt_ymdn._&model_run_key.
63 , debug = FALSE
64 );
65
66/* Create parameter table for the MIP model */
67data mippmx.lgd_risk_index_pmx_&model_run_key.;
68 length
69 _NAME_ $100.
70 _VALUE_ 8.
71 ;
72 /* Risk index (k) for Frye-Jacobs LGD model */
73 _NAME_ = "CI_TERM_LOANS"; _VALUE_ = 0.359998542; output;
74 _NAME_ = "LINE_OF_CREDIT"; _VALUE_ = 0.359998542; output;
75 _NAME_ = "CRE_CONSTRUCTION_LOANS"; _VALUE_ = 0.1541196672; output;
76 _NAME_ = "CRE_CONSTRUCTION_LOANS_P"; _VALUE_ = 0.1541196672; output;
77 _NAME_ = "CRE_PERM_LOANS"; _VALUE_ = 0.1541196672; output;
78run;