SAS Documentation
SASĀ® Solution for Stress Testing
Reference manual - version 08.2021
Loading...
Searching...
No Matches
irmst_model_precode_simMarket.sas
1/*
2 The following SAS macro variables are available to the model at run time:
3 - ticket: SAS authentication service ticket (useful for performing operations that require authentication, i.e. interacting with REST services).
4 - rgf_protocol: Communication protocol (http/https) of the SAS Risk and Governance Framework web application
5 - rgf_host: Hostname of the SAS Risk and Governance Framework web application
6 - rgf_port: Port where the SAS Risk and Governance Framework web application is listening
7 - rgf_service: The service where the SAS Risk and Governance Framework web application is listening
8 - ds_in_portfolio: portfolio table
9 - ds_in_scenario: scenario table
10 - ds_in_counterparty: counterparty table (if used)
11 - ds_in_mitigant: credit risk mitigant table (if used)
12
13 The following libraries are pre assigned:
14 - mipport: MIP portfolio library
15 - mipcpty: MIP counterparty library
16 - mipmit: MIP credit risk mitigant library
17 - mipcf: MIP cashflow library
18 - mippmx: MIP parameter matrix library
19 - mippmx: MIP valueData library
20 - mipfunc: MIP functions library
21
22*/
23
24/*The model does not support pricing cubes unless the DISTRIBUTE_POSITIONS=YES.*/
25%let mipProcHpriskArguments = %bquote(distribute_positions = YES priceby = positions;);
26
27/* Cashflow data object key */
28%let cashflow_key = ${params.CASHFLOW.key};
29
30/*It determines which information should be extracted from the simstat tables (These are MIP output tables.)*/
31%let mipQueryFilter=simulationPart in("P/L", "Exposure", "_ACCINT_", "_DUR_", "_YIELD_", "_SWAP_DUR_", "_VALUE_ORIG_CURRENCY_", "_DUR_CCY1_LEG_", "_DUR_CCY2_LEG_", "_DUR_FIX_LEG_", "_DUR_FLOAT_LEG_");
32
33/*In this model the mip horizon is always larger (+1) because the VAR and the EC variable are based on the PD for the coming period.*/
34%let mipHorizon=%eval(&maxForecastTime.+1);
35
36
37%*irm_file_append(file = /opt/sas/repositories/risk/rqsst/irm/source/sas/misc/examples/market_risk_factors1.sas
38 , toFile = &model_input_dir./economics/scenarios_&base_dt_ymdn._&model_run_key._&run_idx./market_risk_factors1.sas
39 );
40%*irm_file_append(file = /opt/sas/repositories/risk/rqsst/irm/source/sas/misc/examples/market_risk_factors2.sas
41 , toFile = &model_input_dir./economics/scenarios_&base_dt_ymdn._&model_run_key._&run_idx./market_risk_factors2.sas
42 );
43
44
45
46
47
48/* Common Simulation Multipliers Flag */
49%let ecoSimMultiFlag = ${params.ECONSIMMULTIPLIERFLAG};
50
51
52
53
54
55
56
57
58
59
60
61/* Set logging options (based on the value of LOG_LEVEL macro variable) */
62%irm_set_logging_options();
63
64
65
66
67
68%if %upcase(&ecoSimMultiFlag.)=Y %then %do;
69
70 %let ds_scenario = scn_&run_idx..scenario_data;
71 %let ds_econSimulation = _sim_.econsim_&base_dt_ymdn._&model_run_key._&run_idx.;
72
73 %irmst_market_regenerate_econsim( ds_in_scenario = &ds_scenario.
74 , ds_in_econsim = &ds_econSimulation.
75 );
76%end;