SAS Documentation
SASĀ® Solution for Stress Testing
Reference manual - version 08.2021
Loading...
Searching...
No Matches
irmst_model_postcode_EBA2020.sas
1/* ************************************************** *
2 * Model Post-Code Template *
3 * ************************************************** *
4
5Purpose:
6 Injection point for executing custom code after the MIP model execution
7
8Details:
9 The following SAS macro variables are available to the model at run time:
10 - ticket: SAS authentication service ticket (useful for performing operations that require authentication, i.e. interacting with REST services).
11 - rgf_protocol: Communication protocol (http/https) of the SAS Risk and Governance Framework web application
12 - rgf_host: Hostname of the SAS Risk and Governance Framework web application
13 - rgf_port: Port where the SAS Risk and Governance Framework web application is listening
14 - ds_in_model_result: Name of the input table containing the result of the MIP model execution
15 - ds_out_model_result: Name of the output table to be created by this code
16
17 * ************************************************** */
18
19
20
21
22 /*it renames the output variables generated by the computed method.*/
23%macro run_postexec_eba2020(debug_flg=FALSE);
24 %local
25 cnt_cm
26 ;
27
28
29
30 %let cnt_cm = %sysfunc(countw(&mipcomputedmethods., %str( )));
31
32
33
34 /*It transposes and renames the output variable generated by the computed methods.*/
35 data &ds_out_model_result.;
36 set &ds_in_model_result.;
37 array provision(&cnt_cm.)
38 %do i_cm=1 %to &cnt_cm.;
39 %scan(&mipcomputedmethods.,&i_cm., %str( ))
40 %end;
41 ;
42 %do i_cm=0 %to %eval(&cnt_cm.-1);
43 if forecast_time=&i_cm. then do;
44 ALLOWANCE_AMT=provision[&i_cm.+1];
45 end;
46 %end;
47 drop
48 %do i_cm=1 %to &cnt_cm.;
49 %scan(&mipcomputedmethods.,&i_cm., %str( ))
50 %end;
51 ;
52 run;
53
54
55 /*By default, temporary results are stored under the WORK llibname*/
56 libname libdebug %sysfunc(quote(%sysfunc(pathname(work)))) ;
57
58 /*If the debug option is set to TRUE, then you have the option to store the temporary results under a different LILBNAME*/
59 %if %upcase(&debug_flg.) = TRUE %then %do;
60 /*if the folder does not exist, create it manually!!*/
61 libname libdebug '/opt/sas/repositories/risk/debug';
62 data libdebug.eba2020pre;
63 set &ds_in_model_result.;
64 run;
65 data libdebug.eba2020post;
66 set &ds_out_model_result.;
67 run;
68 %end;
69
70%mend;
71
72%run_postexec_eba2020();
73