6%let rgf_tgt_ticket = ${globals.ticket};
9%let sas_risk_workgroup_dir = ${globals.sas_risk_workgroup_dir};
12%let cycle_id = ${context.cycle.key};
15%let analysis_run_id = ${context.analysisRun.key};
18%let config_set_id = ${params.CONFIGSETID};
21%let portfolio_key = ${params.PORTFOLIO.key};
24%let counterparty_key = ${params.CREDITMODEL.params.COUNTERPARTY.key};
27%let mitigant_key = ${params.CREDITMODEL.params.MITIGATION.key};
30%let collateral_key = ${params.CREDITMODEL.params.COLLATERAL.key};
33%let econsimulation_key = ${params.CREDITMODEL.params.ECONSIMULATION.key};
36%let ia_data_key = ${params.IADATA.key};
38%let modelIn_dataMap_key = ${params.MODELINPUTMAP.key};
41%let modelOut_dataMap_key = ${params.MODELOUTPUTMAP.key};
44%let model_run_key = ${params.CREDITMODEL.rels(
"context").modelRun.key};
47%let keep_mip_cube_flg = ${params.KEEPMIPCUBE};
50%let lasr_load_method = ${params.LASRLOADMETHOD};
53%let reload_key_list = ${params.RELOADKEYLIST};
55%let reload_key_list = %sysfunc(prxchange(s/\W+/ /i, -1, %superq(reload_key_list)));
58${function:ProcessModelParameter(params.BEP,
"BEP",
"MRS")}
61%let log_level = ${params.LOGLEVEL};
64%let max_wait = ${params.MAXWAIT};
69%include
"&sas_risk_workgroup_dir./groups/Public/SASRiskManagementCore/cycles/&cycle_id./init.sas" / lrecl = 32000 source2;
72%irm_set_logging_options();
76%let jobflow_category = Analytics;
77%let jobflow_type = %lowcase(irm&solutionId._credit_risk);
78%let instance_date = %sysfunc(date(), yymmddp10.);
79%let instance_time = %sysfunc(prxchange(s/(\d+):(\d+):(\d+)/$1h$2m$3s/i, -1, %sysfunc(time(), tod8.)));
80%let instanceName = Credit Risk Analysis &instance_date._&instance_time.;
81%let instanceDesc = Credit Risk Analysis;
84%let reload_lasr_flg = %irmc_process_lasr_load_method(&lasr_load_method.);
92 config_name =
"RMC_FA_ID"; config_value =
"&rmc_fa_id."; output;
93 config_name =
"CYCLE_ID"; config_value =
"&cycle_id."; output;
94 config_name =
"ANALYSIS_RUN_ID"; config_value =
"&analysis_run_id."; output;
95 config_name =
"ANALYSIS_TYPE"; config_value =
"SCR"; output;
96 config_name =
"MAX_WAIT"; config_value =
"&max_wait."; output;
97 config_name =
"LOG_LEVEL"; config_value =
"&log_level."; output;
98 config_name =
"RELOAD_LASR_FLG"; config_value =
"&reload_lasr_flg."; output;
99 config_name =
"RELOAD_KEY_LIST"; config_value =
"&reload_key_list."; output;
100 config_name =
"TGT_TICKET"; config_value =
"&rgf_tgt_ticket."; output;
104data work.credit_risk_config;
109 config_name =
"CREDIT_MODEL_RUN_KEY"; config_value =
"&model_run_key."; output;
110 config_name =
"PORTFOLIO_KEY"; config_value =
"&portfolio_key."; output;
111 config_name =
"COUNTERPARTY_KEY"; config_value =
"&counterparty_key."; output;
112 config_name =
"MITIGANT_KEY"; config_value =
"&mitigant_key."; output;
113 config_name =
"COLLATERAL_KEY"; config_value =
"&collateral_key."; output;
114 config_name =
"ECONSIMULATION_KEY"; config_value =
"&econsimulation_key."; output;
115 config_name =
"IA_DATA"; config_value =
"&ia_data_key."; output;
116 config_name =
"MODELIN_DATAMAP_KEY"; config_value =
"&modelIn_dataMap_key."; output;
117 config_name =
"MODELOUT_DATAMAP_KEY"; config_value =
"&modelOut_dataMap_key."; output;
118 config_name =
"KEEP_MIP_CUBE_FLG"; config_value =
"&keep_mip_cube_flg."; output;
123data bep_x_mrs_config;
124 length BEP_KEY MRS_KEY 8.;
125 keep BEP_KEY MRS_KEY;
126 bep_cnt = symgetn(
"BEP_CNT");
128 bep_key = symgetn(cats(
"BEP_", n));
129 mrs_cnt = symgetn(cats(
"BEP_", n,
"_MRS_CNT"));
130 if mrs_cnt <= 0 then
do;
131 put
"ERROR: No Master Risk Scenarios have been assigned to Business Evolution Plan Id " bep_key;
132 call symput(
"httpSuccess", 0);
136 mrs_key = symgetn(cats(
"BEP_", n,
"_MRS_", i));
142%macro check_httpSuccess;
143 %
if &httpSuccess. ne 1 %then %
do;
146%mend check_httpSuccess;
152%let jobflow_status = Unknown;
154%irm_rest_create_jobflow_instance(instance_name = &instanceName.
155 , description = &instanceDesc.
156 , entityId = &entity_id.
157 , entityRoleKey = &entity_role_key.
158 , category = &jobflow_category.
159 , jobflowFile = &jobflow_type.
160 , baseDate = &irm_base_dt.
161 , configSetId = &config_set_id.
162 , federatedAreaID = &irm_fa_id.
163 , sourceFederatedAreaId = &irm_fa_id.
164 , src_param_tables = work.run_option work.credit_risk_config
165 , tgt_param_tables = &solutionLibrefPrefix._CFG.RUN_OPTION &solutionLibrefPrefix._CFG.CREDIT_RISK_CONFIG
166 , src_upload_tables = work.bep_x_mrs_config
167 , tgt_upload_tables = &solutionLibrefPrefix._CFG.BEP_X_MRS_CONFIG
171 , maxWait = &max_wait.
172 , host = &irm_protocol.:
174 , tgt_ticket = &rgf_tgt_ticket.
175 , outvar = instanceKey
176 , outVarStatus = jobflow_status
179%
if(&jobflow_status. = Successful) %then %
do;
181 %irmc_refresh_lasr_schema_view(lasr_lib = &lasr_libref.
182 , mart_table_name = &solutionId._CREDIT_RISK_DETAIL
183 , rls_table_name = &solutionId._CREDIT_RISK_DETAIL_RLS
184 , meta_repository = &meta_repository.
185 , lasr_library_name = &lasr_library_name.
186 , lasr_meta_folder = &lasr_meta_folder.
191%irmc_update_ctrl_table(cycle_id = &cycle_id.
192 , analysis_run_id = &analysis_run_id.
193 , dr_libref = &dr_libref.
195 , entry_id = &instanceKey.
196 , entry_name = &instanceName.