SAS Documentation
SASĀ® Solution for Stress Testing
Reference manual - version 08.2021
Loading...
Searching...
No Matches
irmst_get_tm_analysis_data.sas
1/*------------------------------------------------------------------------------
2 * NAME: irmst_get_tm_analysis_data.sas
3 *
4 * PURPOSE: Retrieve TM Results Analysis Data Object and Transpose
5 *
6 * MACRO OPTIONS:
7 * ad_libref - Libref of data repository
8 * DEFAULT: rqsst
9 * debug - OPTIONAL: Specify TRUE to keep intermediate tables
10 * in_tm_analysis_data_key - Analysis data key of TM results to retrieve from RGF (input)
11 * out_tm_set - Name of the output TM set (in square form)
12 * rgf_host - Host name for RGF
13 * rgf_port - Server port for RGF
14 * DEFAULT: 7980
15 * rgf_protocol - Protocol for RGF
16 * rgf_service - Name of the Web Application Server that
17 * provides the REST service for RGF
18 * DEFAULT: SASRiskGovernanceFramework
19 * rgf_solution - Solution identifer for RGF content packages
20 * DEFAULT: stm
21 * tgt_ticket - Specify generated TGT
22 *
23 *------------------------------------------------------------------------------*/
24%macro irmst_get_tm_analysis_data(ad_libref = rqsst
25 , debug = FALSE
26 , in_tm_analysis_data_key =
27 , out_tm_set = work.tm_set
28 , rgf_host =
29 , rgf_port =
30 , rgf_protocol =
31 , rgf_service =
32 , rgf_solution =
33 , tgt_ticket =
34 ) / minoperator;
35
36 %local _debug_
37 httpSuccess
38 responseStatus
39 ticket_tm_upload;
40
41 /*-----------------------
42 * Align debug parameter
43 *-----------------------*/
44 %if %qupcase(&debug) in (Y YES 1 TRUE) %then
45 %let _debug_ = YES;
46 %else
47 %let _debug_ = NO;
48
49 /*-----------------------------------
50 * Retrieve TM results analysis data
51 *-----------------------------------*/
52 %let httpSuccess = 0;
53 %let responseStatus = ;
54 %let ticket_tm_get = ;
55 %irm_rgf_retrieve_analysis_data(key = &in_tm_analysis_data_key.
56 , libref = &ad_libref.
57 , outds = work._transition_matrix_results
58 , outds_partition_list = work._tm_partition_list
59 , out_type = data
60 , outds_dataInfo = work._tm_dataInfo
61 , outds_dataDef = work._tm_dataDef
62 , host = &rgf_protocol.://&rgf_host.
63 , server = &rgf_service.
64 , solution = &rgf_solution.
65 , port = &rgf_port.
66 , tgt_ticket = %superq(tgt_ticket)
67 , outVarTicket = ticket_tm_get
68 , outSuccess = httpSuccess
69 , outResponseStatus = responseStatus
70 , restartLUA = Y
71 , clearCache = Y
72 );
73
74 /*--------------------------------------------------------
75 * Sort to transpose tm results data set to square form
76 *--------------------------------------------------------*/
77 proc sort data = work._transition_matrix_results
78 out = work._tm_tbl_sorted;
79 by modeling_system_name
80 modeling_system_version
81 model_group_name
82 master_risk_scenario_name
83 mip_scenario_name
84 insttype
85 scenario_date
86 order_num;
87 run;
88
89 proc transpose data = work._tm_tbl_sorted (drop = order_num)
90 out = &out_tm_set (drop = _name_);
91 var transition_probabilities;
92 by modeling_system_name
93 modeling_system_version
94 model_group_name
95 master_risk_scenario_name
96 mip_scenario_name
97 insttype
98 scenario_date
99 from_risk_rating notsorted;
100 id to_risk_rating;
101 run;
102
103 /*----------------------------------------------
104 * If debug set to NO, drop intermediate tables
105 *----------------------------------------------*/
106 %if %qupcase(&_debug_.) eq NO %then
107 %do;
108 proc sql;
109 drop table work._transition_matrix_results,
110 work._tm_partition_list,
111 work._tm_dataInfo,
112 work._tm_dataDef,
113 work._tm_tbl_sorted
114 ;
115 quit;
116 %end;
117
118%mend irmst_get_tm_analysis_data;