DBA Data[Home] [Help]

APPS.QRM_PA_CALCULATION_P dependencies on XTR_RISK_DEBUG_PKG

Line 15: -- XTR_RISK_DEBUG_PKG.start_debug('/sqlcom/out/findv115', 'fhpatest.dbg');

11:
12: p_ref_datetime DATE := NVL(TO_DATE(p_date, 'YYYY/MM/DD HH24:MI:SS'), SYSDATE);
13:
14: BEGIN
15: -- XTR_RISK_DEBUG_PKG.start_debug('/sqlcom/out/findv115', 'fhpatest.dbg');
16: -- XTR_RISK_DEBUG_PKG.start_debug;
17: XTR_RISK_DEBUG_PKG.start_conc_prog;
18: IF (g_proc_level>=g_debug_level) THEN
19: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS_CP');

Line 16: -- XTR_RISK_DEBUG_PKG.start_debug;

12: p_ref_datetime DATE := NVL(TO_DATE(p_date, 'YYYY/MM/DD HH24:MI:SS'), SYSDATE);
13:
14: BEGIN
15: -- XTR_RISK_DEBUG_PKG.start_debug('/sqlcom/out/findv115', 'fhpatest.dbg');
16: -- XTR_RISK_DEBUG_PKG.start_debug;
17: XTR_RISK_DEBUG_PKG.start_conc_prog;
18: IF (g_proc_level>=g_debug_level) THEN
19: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS_CP');
20: XTR_RISK_DEBUG_PKG.dlog('run_analysis_cp: ' || 'source is', p_source);

Line 17: XTR_RISK_DEBUG_PKG.start_conc_prog;

13:
14: BEGIN
15: -- XTR_RISK_DEBUG_PKG.start_debug('/sqlcom/out/findv115', 'fhpatest.dbg');
16: -- XTR_RISK_DEBUG_PKG.start_debug;
17: XTR_RISK_DEBUG_PKG.start_conc_prog;
18: IF (g_proc_level>=g_debug_level) THEN
19: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS_CP');
20: XTR_RISK_DEBUG_PKG.dlog('run_analysis_cp: ' || 'source is', p_source);
21: XTR_RISK_DEBUG_PKG.dlog('run_analysis_cp: ' || 'analysis name', p_analysis_name);

Line 19: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS_CP');

15: -- XTR_RISK_DEBUG_PKG.start_debug('/sqlcom/out/findv115', 'fhpatest.dbg');
16: -- XTR_RISK_DEBUG_PKG.start_debug;
17: XTR_RISK_DEBUG_PKG.start_conc_prog;
18: IF (g_proc_level>=g_debug_level) THEN
19: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS_CP');
20: XTR_RISK_DEBUG_PKG.dlog('run_analysis_cp: ' || 'source is', p_source);
21: XTR_RISK_DEBUG_PKG.dlog('run_analysis_cp: ' || 'analysis name', p_analysis_name);
22: XTR_RISK_DEBUG_PKG.dlog('run_analysis_cp: ' || 'ref date', p_ref_datetime);
23: END IF;

Line 20: XTR_RISK_DEBUG_PKG.dlog('run_analysis_cp: ' || 'source is', p_source);

16: -- XTR_RISK_DEBUG_PKG.start_debug;
17: XTR_RISK_DEBUG_PKG.start_conc_prog;
18: IF (g_proc_level>=g_debug_level) THEN
19: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS_CP');
20: XTR_RISK_DEBUG_PKG.dlog('run_analysis_cp: ' || 'source is', p_source);
21: XTR_RISK_DEBUG_PKG.dlog('run_analysis_cp: ' || 'analysis name', p_analysis_name);
22: XTR_RISK_DEBUG_PKG.dlog('run_analysis_cp: ' || 'ref date', p_ref_datetime);
23: END IF;
24: run_analysis(retcode, p_source, p_analysis_name, p_ref_datetime);

Line 21: XTR_RISK_DEBUG_PKG.dlog('run_analysis_cp: ' || 'analysis name', p_analysis_name);

17: XTR_RISK_DEBUG_PKG.start_conc_prog;
18: IF (g_proc_level>=g_debug_level) THEN
19: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS_CP');
20: XTR_RISK_DEBUG_PKG.dlog('run_analysis_cp: ' || 'source is', p_source);
21: XTR_RISK_DEBUG_PKG.dlog('run_analysis_cp: ' || 'analysis name', p_analysis_name);
22: XTR_RISK_DEBUG_PKG.dlog('run_analysis_cp: ' || 'ref date', p_ref_datetime);
23: END IF;
24: run_analysis(retcode, p_source, p_analysis_name, p_ref_datetime);
25: IF (g_proc_level>=g_debug_level) THEN

Line 22: XTR_RISK_DEBUG_PKG.dlog('run_analysis_cp: ' || 'ref date', p_ref_datetime);

18: IF (g_proc_level>=g_debug_level) THEN
19: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS_CP');
20: XTR_RISK_DEBUG_PKG.dlog('run_analysis_cp: ' || 'source is', p_source);
21: XTR_RISK_DEBUG_PKG.dlog('run_analysis_cp: ' || 'analysis name', p_analysis_name);
22: XTR_RISK_DEBUG_PKG.dlog('run_analysis_cp: ' || 'ref date', p_ref_datetime);
23: END IF;
24: run_analysis(retcode, p_source, p_analysis_name, p_ref_datetime);
25: IF (g_proc_level>=g_debug_level) THEN
26: XTR_RISK_DEBUG_PKG.dpop(null,'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS_CP');

Line 26: XTR_RISK_DEBUG_PKG.dpop(null,'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS_CP');

22: XTR_RISK_DEBUG_PKG.dlog('run_analysis_cp: ' || 'ref date', p_ref_datetime);
23: END IF;
24: run_analysis(retcode, p_source, p_analysis_name, p_ref_datetime);
25: IF (g_proc_level>=g_debug_level) THEN
26: XTR_RISK_DEBUG_PKG.dpop(null,'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS_CP');
27: END IF;
28: XTR_RISK_DEBUG_PKG.stop_conc_debug;
29: END run_analysis_cp;
30:

Line 28: XTR_RISK_DEBUG_PKG.stop_conc_debug;

24: run_analysis(retcode, p_source, p_analysis_name, p_ref_datetime);
25: IF (g_proc_level>=g_debug_level) THEN
26: XTR_RISK_DEBUG_PKG.dpop(null,'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS_CP');
27: END IF;
28: XTR_RISK_DEBUG_PKG.stop_conc_debug;
29: END run_analysis_cp;
30:
31:
32:

Line 60: -- XTR_RISK_DEBUG_PKG.start_debug('/sqlcom/out/findv115','fhpatest.dbg');

56: call_status BOOLEAN;
57:
58: BEGIN
59:
60: -- XTR_RISK_DEBUG_PKG.start_debug('/sqlcom/out/findv115','fhpatest.dbg');
61: -- XTR_RISK_DEBUG_PKG.start_debug;
62: IF (g_proc_level>=g_debug_level) THEN --bug 3236479
63: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS_AM');
64: END IF;

Line 61: -- XTR_RISK_DEBUG_PKG.start_debug;

57:
58: BEGIN
59:
60: -- XTR_RISK_DEBUG_PKG.start_debug('/sqlcom/out/findv115','fhpatest.dbg');
61: -- XTR_RISK_DEBUG_PKG.start_debug;
62: IF (g_proc_level>=g_debug_level) THEN --bug 3236479
63: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS_AM');
64: END IF;
65:

Line 63: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS_AM');

59:
60: -- XTR_RISK_DEBUG_PKG.start_debug('/sqlcom/out/findv115','fhpatest.dbg');
61: -- XTR_RISK_DEBUG_PKG.start_debug;
62: IF (g_proc_level>=g_debug_level) THEN --bug 3236479
63: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS_AM');
64: END IF;
65:
66: IF FND_MSG_PUB.count_msg > 0 THEN
67: FND_MSG_PUB.initialize;

Line 72: xtr_risk_debug_pkg.dlog('run_analysis_am: ' || 'analysis name: '||p_analysis_names(i));

68: END IF;
69:
70: FOR i IN 1..p_analysis_names.COUNT LOOP
71: IF (g_proc_level>=g_debug_level) THEN
72: xtr_risk_debug_pkg.dlog('run_analysis_am: ' || 'analysis name: '||p_analysis_names(i));
73: END IF;
74: OPEN check_analysis(p_analysis_names(i));
75: FETCH check_analysis INTO p_settings;
76: IF (check_analysis%NOTFOUND) THEN

Line 81: xtr_risk_debug_pkg.dlog('run_analysis_am: ' || 'analysis not found');

77: FND_MESSAGE.set_name('QRM', 'QRM_ANA_NO_SETTING');
78: FND_MESSAGE.set_token('ANALYSIS_NAME', p_settings.analysis_name);
79: FND_MSG_PUB.add;
80: IF (g_proc_level>=g_debug_level) THEN
81: xtr_risk_debug_pkg.dlog('run_analysis_am: ' || 'analysis not found');
82: END IF;
83: ELSIF (p_settings.status = '3') THEN
84: call_status := FND_CONCURRENT.get_request_status(
85: p_settings.process_id,'','', rphase, rstatus, dphase,

Line 88: XTR_RISK_DEBUG_PKG.dlog('run_analysis_am: ' || 'dphase is', dphase);

84: call_status := FND_CONCURRENT.get_request_status(
85: p_settings.process_id,'','', rphase, rstatus, dphase,
86: dstatus, message);
87: IF (g_proc_level>=g_debug_level) THEN
88: XTR_RISK_DEBUG_PKG.dlog('run_analysis_am: ' || 'dphase is', dphase);
89: END IF;
90: IF (dphase IN ('PENDING', 'RUNNING', 'INACTIVE')) THEN
91: FND_MESSAGE.set_name('QRM', 'QRM_ANA_RUN_IN_PROGRESS');
92: FND_MESSAGE.set_token('ANALYSIS', p_settings.analysis_name);

Line 95: xtr_risk_debug_pkg.dlog('run_analysis_am: ' || 'status is 3');

91: FND_MESSAGE.set_name('QRM', 'QRM_ANA_RUN_IN_PROGRESS');
92: FND_MESSAGE.set_token('ANALYSIS', p_settings.analysis_name);
93: FND_MSG_PUB.add;
94: IF (g_proc_level>=g_debug_level) THEN
95: xtr_risk_debug_pkg.dlog('run_analysis_am: ' || 'status is 3');
96: END IF;
97: p_go_calculate := FALSE;
98: ELSE
99: p_go_calculate := TRUE;

Line 109: XTR_RISK_DEBUG_PKG.dlog('run_analysis_am: ' || 'request id: '||p_request_id);

105: p_source,
106: p_analysis_names(i),
107: to_char(p_ref_datetime,'YYYY/MM/DD HH24:MI:SS'));
108: IF (g_proc_level>=g_debug_level) THEN
109: XTR_RISK_DEBUG_PKG.dlog('run_analysis_am: ' || 'request id: '||p_request_id);
110: END IF;
111: IF (p_request_id = 0) THEN
112: FND_MESSAGE.RETRIEVE(p_msg);
113: -- FND_MESSAGE.ERROR;

Line 115: XTR_RISK_DEBUG_PKG.dlog('run_analysis_am: ' || 'error msg: '||p_msg);

111: IF (p_request_id = 0) THEN
112: FND_MESSAGE.RETRIEVE(p_msg);
113: -- FND_MESSAGE.ERROR;
114: IF (g_proc_level>=g_debug_level) THEN
115: XTR_RISK_DEBUG_PKG.dlog('run_analysis_am: ' || 'error msg: '||p_msg);
116: END IF;
117: FND_MESSAGE.set_name('QRM', 'QRM_ANA_SUBMIT_ERROR');
118: FND_MESSAGE.set_token('ANALYSIS', p_analysis_names(i));
119: FND_MSG_PUB.add;

Line 121: xtr_risk_debug_pkg.dlog('run_analysis_am: ' || 'request not submitted');

117: FND_MESSAGE.set_name('QRM', 'QRM_ANA_SUBMIT_ERROR');
118: FND_MESSAGE.set_token('ANALYSIS', p_analysis_names(i));
119: FND_MSG_PUB.add;
120: IF (g_proc_level>=g_debug_level) THEN
121: xtr_risk_debug_pkg.dlog('run_analysis_am: ' || 'request not submitted');
122: END IF;
123: ELSE
124: IF (g_proc_level>=g_debug_level) THEN
125: xtr_risk_debug_pkg.dlog('run_analysis_am: ' || 'request submitted: '||p_request_id);

Line 125: xtr_risk_debug_pkg.dlog('run_analysis_am: ' || 'request submitted: '||p_request_id);

121: xtr_risk_debug_pkg.dlog('run_analysis_am: ' || 'request not submitted');
122: END IF;
123: ELSE
124: IF (g_proc_level>=g_debug_level) THEN
125: xtr_risk_debug_pkg.dlog('run_analysis_am: ' || 'request submitted: '||p_request_id);
126: END IF;
127: -- this updates the history_flag='C' row only!
128: UPDATE qrm_analysis_settings
129: SET status='3',

Line 141: XTR_RISK_DEBUG_PKG.dpop(null,'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS_AM');

137: CLOSE check_analysis;
138: END LOOP;
139:
140: IF (g_proc_level>=g_debug_level) THEN --bug 3236479
141: XTR_RISK_DEBUG_PKG.dpop(null,'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS_AM');
142: END IF;
143:
144: XTR_RISK_DEBUG_PKG.stop_debug;
145: END run_analysis_am;

Line 144: XTR_RISK_DEBUG_PKG.stop_debug;

140: IF (g_proc_level>=g_debug_level) THEN --bug 3236479
141: XTR_RISK_DEBUG_PKG.dpop(null,'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS_AM');
142: END IF;
143:
144: XTR_RISK_DEBUG_PKG.stop_debug;
145: END run_analysis_am;
146:
147:
148:

Line 942: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_CALCULATION_P.RUN_ANALYSIS'); --bug3236479

938:
939: BEGIN
940:
941: IF (g_proc_level>=g_debug_level) THEN
942: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_CALCULATION_P.RUN_ANALYSIS'); --bug3236479
943: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'source is', p_source);
944: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'analysis name', p_analysis_name);
945: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'ref date', p_ref_datetime);
946: END IF;

Line 943: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'source is', p_source);

939: BEGIN
940:
941: IF (g_proc_level>=g_debug_level) THEN
942: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_CALCULATION_P.RUN_ANALYSIS'); --bug3236479
943: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'source is', p_source);
944: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'analysis name', p_analysis_name);
945: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'ref date', p_ref_datetime);
946: END IF;
947:

Line 944: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'analysis name', p_analysis_name);

940:
941: IF (g_proc_level>=g_debug_level) THEN
942: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_CALCULATION_P.RUN_ANALYSIS'); --bug3236479
943: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'source is', p_source);
944: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'analysis name', p_analysis_name);
945: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'ref date', p_ref_datetime);
946: END IF;
947:
948: p_select_clause := p_select_clause||'foreign_ccy, domestic_ccy, base_ccy, contra_ccy, premium_ccy, buy_amount, sell_amount, foreign_amount, domestic_amount, ';

Line 945: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'ref date', p_ref_datetime);

941: IF (g_proc_level>=g_debug_level) THEN
942: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_CALCULATION_P.RUN_ANALYSIS'); --bug3236479
943: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'source is', p_source);
944: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'analysis name', p_analysis_name);
945: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'ref date', p_ref_datetime);
946: END IF;
947:
948: p_select_clause := p_select_clause||'foreign_ccy, domestic_ccy, base_ccy, contra_ccy, premium_ccy, buy_amount, sell_amount, foreign_amount, domestic_amount, ';
949: p_select_clause := p_select_clause||'base_ccy_amount, contra_ccy_amount, start_amount, face_value, interest, accum_interest_bf, accum_int_action, ';

Line 991: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'dphase is', dphase);

987: call_status := FND_CONCURRENT.get_request_status(
988: p_request_id,'','', rphase, rstatus,
989: dphase, dstatus, message);
990: IF (g_proc_level>=g_debug_level) THEN
991: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'dphase is', dphase);
992: END IF;
993: IF (dphase IN ('PENDING', 'RUNNING', 'INACTIVE')) THEN
994: raise e_analysis_in_progress;
995: END IF;

Line 1001: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'ref date: '||p_ref_date);

997: CLOSE get_settings;
998:
999: -- get the from and to dates
1000: IF (g_proc_level>=g_debug_level) THEN
1001: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'ref date: '||p_ref_date);
1002: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'date type: '||p_settings.date_type);
1003: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date: '||p_settings.start_date);
1004: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'end date: '||p_settings.end_date);
1005: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date ref: '||p_settings.start_date_ref);

Line 1002: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'date type: '||p_settings.date_type);

998:
999: -- get the from and to dates
1000: IF (g_proc_level>=g_debug_level) THEN
1001: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'ref date: '||p_ref_date);
1002: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'date type: '||p_settings.date_type);
1003: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date: '||p_settings.start_date);
1004: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'end date: '||p_settings.end_date);
1005: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date ref: '||p_settings.start_date_ref);
1006: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date offset: '||p_settings.start_date_offset);

Line 1003: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date: '||p_settings.start_date);

999: -- get the from and to dates
1000: IF (g_proc_level>=g_debug_level) THEN
1001: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'ref date: '||p_ref_date);
1002: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'date type: '||p_settings.date_type);
1003: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date: '||p_settings.start_date);
1004: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'end date: '||p_settings.end_date);
1005: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date ref: '||p_settings.start_date_ref);
1006: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date offset: '||p_settings.start_date_offset);
1007: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start offset type: '||p_settings.start_offset_type);

Line 1004: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'end date: '||p_settings.end_date);

1000: IF (g_proc_level>=g_debug_level) THEN
1001: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'ref date: '||p_ref_date);
1002: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'date type: '||p_settings.date_type);
1003: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date: '||p_settings.start_date);
1004: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'end date: '||p_settings.end_date);
1005: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date ref: '||p_settings.start_date_ref);
1006: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date offset: '||p_settings.start_date_offset);
1007: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start offset type: '||p_settings.start_offset_type);
1008: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'gl calendar id: '||p_settings.gl_calendar_id);

Line 1005: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date ref: '||p_settings.start_date_ref);

1001: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'ref date: '||p_ref_date);
1002: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'date type: '||p_settings.date_type);
1003: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date: '||p_settings.start_date);
1004: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'end date: '||p_settings.end_date);
1005: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date ref: '||p_settings.start_date_ref);
1006: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date offset: '||p_settings.start_date_offset);
1007: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start offset type: '||p_settings.start_offset_type);
1008: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'gl calendar id: '||p_settings.gl_calendar_id);
1009: END IF;

Line 1006: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date offset: '||p_settings.start_date_offset);

1002: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'date type: '||p_settings.date_type);
1003: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date: '||p_settings.start_date);
1004: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'end date: '||p_settings.end_date);
1005: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date ref: '||p_settings.start_date_ref);
1006: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date offset: '||p_settings.start_date_offset);
1007: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start offset type: '||p_settings.start_offset_type);
1008: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'gl calendar id: '||p_settings.gl_calendar_id);
1009: END IF;
1010:

Line 1007: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start offset type: '||p_settings.start_offset_type);

1003: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date: '||p_settings.start_date);
1004: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'end date: '||p_settings.end_date);
1005: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date ref: '||p_settings.start_date_ref);
1006: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date offset: '||p_settings.start_date_offset);
1007: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start offset type: '||p_settings.start_offset_type);
1008: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'gl calendar id: '||p_settings.gl_calendar_id);
1009: END IF;
1010:
1011:

Line 1008: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'gl calendar id: '||p_settings.gl_calendar_id);

1004: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'end date: '||p_settings.end_date);
1005: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date ref: '||p_settings.start_date_ref);
1006: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date offset: '||p_settings.start_date_offset);
1007: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start offset type: '||p_settings.start_offset_type);
1008: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'gl calendar id: '||p_settings.gl_calendar_id);
1009: END IF;
1010:
1011:
1012: -- get appropriate from/to dates

Line 1059: XTR_RISK_DEBUG_PKG.dlog('run_analysis: from date is:', p_from_date);

1055: END IF;
1056: END IF;
1057:
1058: IF (g_proc_level>=g_debug_level) THEN
1059: XTR_RISK_DEBUG_PKG.dlog('run_analysis: from date is:', p_from_date);
1060: XTR_RISK_DEBUG_PKG.dlog('run_analysis: to date is:', p_to_date);
1061: END IF;
1062:
1063: -- if not called by Analysis Manager

Line 1060: XTR_RISK_DEBUG_PKG.dlog('run_analysis: to date is:', p_to_date);

1056: END IF;
1057:
1058: IF (g_proc_level>=g_debug_level) THEN
1059: XTR_RISK_DEBUG_PKG.dlog('run_analysis: from date is:', p_from_date);
1060: XTR_RISK_DEBUG_PKG.dlog('run_analysis: to date is:', p_to_date);
1061: END IF;
1062:
1063: -- if not called by Analysis Manager
1064:

Line 1071: XTR_RISK_DEBUG_PKG.dlog('DML','Deleted analysis row with history_flag=S',

1067: FROM qrm_analysis_settings
1068: WHERE analysis_name = p_analysis_name and history_flag='S';
1069:
1070: IF (g_event_level>=g_debug_level) THEN --bug 3236479
1071: XTR_RISK_DEBUG_PKG.dlog('DML','Deleted analysis row with history_flag=S',
1072: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_event_level);
1073: END IF;
1074:
1075: -- delete attributes rows with history_flag='S'

Line 1081: XTR_RISK_DEBUG_PKG.dlog('DML','Deleted attributes rows with history_flag=S',

1077: FROM qrm_analysis_atts
1078: WHERE analysis_name = p_analysis_name and history_flag='S';
1079:
1080: IF (g_event_level>=g_debug_level) THEN --bug 3236479
1081: XTR_RISK_DEBUG_PKG.dlog('DML','Deleted attributes rows with history_flag=S',
1082: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_event_level);
1083: END IF;
1084:
1085: IF (g_state_level>=g_debug_level) THEN --bug 3236479

Line 1103: XTR_RISK_DEBUG_PKG.dlog('INSERT QRM_ANALYSIS_SETTINGS',v_log,

1099: p_settings.gl_calendar_id||','||'S'||','||
1100: p_settings.created_by||','||p_settings.creation_date||','||
1101: p_settings.last_updated_by||','||p_settings.last_update_date||','||
1102: p_settings.last_update_login;
1103: XTR_RISK_DEBUG_PKG.dlog('INSERT QRM_ANALYSIS_SETTINGS',v_log,
1104: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_state_level);
1105: END IF;
1106:
1107: -- make copy of row and set history flag to 'S';

Line 1136: XTR_RISK_DEBUG_PKG.dlog('DML','Inserted into QRM_ANALYSIS_SETTINGS attributes with history_flag=S',

1132: p_settings.last_updated_by, p_settings.last_update_date,
1133: p_settings.last_update_login);
1134:
1135: IF (g_event_level>=g_debug_level) THEN --bug 3236479
1136: XTR_RISK_DEBUG_PKG.dlog('DML','Inserted into QRM_ANALYSIS_SETTINGS attributes with history_flag=S',
1137: 'QRM_CALCULATION_P.RUN_ANALYSIS',g_event_level);
1138: END IF;
1139:
1140: -- store attributes rows for bulk copy

Line 1172: XTR_RISK_DEBUG_PKG.dlog('INSERT QRM_ANALYSIS_ATTS',v_log,

1168: for i in 1..p_att_counter loop
1169: v_log := p_att_name(i)||','||p_analysis_name||','||'S'||','||
1170: p_att_type(i)||','||p_att_order(i)||','||p_att_average(i)||','||
1171: p_att_ind(i)||','|| p_att_percentage(i);
1172: XTR_RISK_DEBUG_PKG.dlog('INSERT QRM_ANALYSIS_ATTS',v_log,
1173: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_state_level);
1174: end loop;
1175: END IF;
1176:

Line 1189: XTR_RISK_DEBUG_PKG.dlog('DML','Inserted into QRM_ANALYSIS_ATTS attributes with history_flag=S',

1185: p_att_created_by(i), p_att_creation_date(i), p_att_updated_by(i),
1186: p_att_update_date(i), p_att_update_login(i));
1187:
1188: IF (g_event_level>=g_debug_level) THEN --bug 3236479
1189: XTR_RISK_DEBUG_PKG.dlog('DML','Inserted into QRM_ANALYSIS_ATTS attributes with history_flag=S',
1190: 'QRM_CALCULATION_P.RUN_ANALYSIS',g_event_level);
1191: END IF;
1192:
1193: -- update status column to "In Progress"

Line 1203: XTR_RISK_DEBUG_PKG.dlog('DML','Updated status column to 3 (In Progress)',

1199: dirty = 'N'
1200: WHERE analysis_name = p_analysis_name;
1201:
1202: IF (g_event_level>=g_debug_level) THEN --bug 3236479
1203: XTR_RISK_DEBUG_PKG.dlog('DML','Updated status column to 3 (In Progress)',
1204: 'QRM_CALCULATION_P.RUN_ANALYSIS',g_event_level);
1205: END IF;
1206:
1207: COMMIT;

Line 1223: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'creating select stmt...');

1219: p_filter_where_clause := ' AND '||p_filter_where_clause;
1220: END IF;
1221:
1222: IF (g_proc_level>=g_debug_level) THEN
1223: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'creating select stmt...');
1224: END IF;
1225: -- construct select statement to exclude closed deals
1226:
1227: /* BUG 2945198 - sql binding

Line 1251: XTR_RISK_DEBUG_PKG.dlog('DML','DELETED QRM_DEALS_ANALYSES',

1247: FROM qrm_deals_analyses
1248: WHERE analysis_name=p_analysis_name;
1249:
1250: IF (g_event_level>=g_debug_level) THEN --bug 3236479
1251: XTR_RISK_DEBUG_PKG.dlog('DML','DELETED QRM_DEALS_ANALYSES',
1252: 'QRM_CALCULATION_P.RUN_ANALYSIS',g_event_level);
1253: END IF;
1254:
1255: v_cursor := dbms_sql.open_cursor;

Line 1264: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'processing batch size: '||p_batch_fetch_size);

1260: p_batch_fetch_size := 1000;
1261: end if;
1262:
1263: IF (g_proc_level>=g_debug_level) THEN
1264: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'processing batch size: '||p_batch_fetch_size);
1265: END IF;
1266:
1267: -- filter out NOCOPY deals according to dates in settings
1268: -- Maturity: from_date <= end_date <= to_date

Line 1273: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'Maturity Analysis');

1269: -- Position: deal_date <= to_date <= end_date
1270: -- Gap: from_date <= gap_date <= to date cannot filter: gap date not known yet
1271: IF (p_settings.analysis_type = 'M') THEN -- maturity analysis
1272: IF (g_proc_level>=g_debug_level) THEN
1273: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'Maturity Analysis');
1274: END IF;
1275: p_appended_where := p_appended_where ||' AND :from_date <= NVL(end_date, :p_ref_date+1) AND NVL(end_date, :p_ref_date+1) <= :to_date AND DEAL_TYPE <> ''STOCK''';
1276:
1277: p_select_stmt := p_select_stmt||p_appended_where||p_filter_where_clause;

Line 1288: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'select stmt: ', p_select_stmt);

1284: /*
1285: p_select_stmt := 'BEGIN '||p_select_stmt||';END;';
1286:
1287: IF (g_proc_level>=g_debug_level) THEN
1288: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'select stmt: ', p_select_stmt);
1289: END IF;
1290:
1291: EXECUTE IMMEDIATE p_select_stmt USING OUT p_deal_nos,
1292: OUT p_transaction_nos, OUT p_market_data_sets, OUT p_company_codes,

Line 1314: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NO OF ROWS RETRIEVED: '||p_deal_nos.count);

1310: IN p_from_date,
1311: IN p_ref_date, IN p_to_date;
1312:
1313: IF (g_proc_level>=g_debug_level) THEN
1314: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NO OF ROWS RETRIEVED: '||p_deal_nos.count);
1315: END IF;
1316: FOR i IN 1..p_deal_nos.count LOOP
1317: IF (g_proc_level>=g_debug_level) THEN
1318: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'd_no: '||p_deal_nos(i)||'; t_no: '||p_transaction_nos(i)||'; type: '||p_deal_types(i)||'; end date: '||p_end_dates(i));

Line 1318: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'd_no: '||p_deal_nos(i)||'; t_no: '||p_transaction_nos(i)||'; type: '||p_deal_types(i)||'; end date: '||p_end_dates(i));

1314: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NO OF ROWS RETRIEVED: '||p_deal_nos.count);
1315: END IF;
1316: FOR i IN 1..p_deal_nos.count LOOP
1317: IF (g_proc_level>=g_debug_level) THEN
1318: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'd_no: '||p_deal_nos(i)||'; t_no: '||p_transaction_nos(i)||'; type: '||p_deal_types(i)||'; end date: '||p_end_dates(i));
1319: END IF;
1320: END LOOP;
1321: */
1322: ELSIF (p_settings.analysis_type = 'P') THEN -- position analysis

Line 1324: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'Position Analysis');

1320: END LOOP;
1321: */
1322: ELSIF (p_settings.analysis_type = 'P') THEN -- position analysis
1323: IF (g_proc_level>=g_debug_level) THEN
1324: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'Position Analysis');
1325: END IF;
1326: p_appended_where := p_appended_where || ' AND ((deal_type<>''FXO'') OR (deal_type=''FXO'' AND (knock_type=''O'' OR knock_type IS NULL OR (knock_type=''I'' and knock_execute_date IS NOT NULL))))';
1327:
1328: IF (p_settings.style = 'X') THEN

Line 1342: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'select stmt: ', p_select_stmt);

1338: /*
1339: p_select_stmt := 'BEGIN '||p_select_stmt||';END;';
1340:
1341: IF (g_proc_level>=g_debug_level) THEN
1342: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'select stmt: ', p_select_stmt);
1343: END IF;
1344:
1345: EXECUTE IMMEDIATE p_select_stmt USING OUT p_deal_nos,
1346: OUT p_transaction_nos, OUT p_market_data_sets,

Line 1379: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'select stmt: ', p_select_stmt);

1375: /*
1376: p_select_stmt := 'BEGIN '||p_select_stmt||';END;';
1377:
1378: IF (g_proc_level>=g_debug_level) THEN
1379: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'select stmt: ', p_select_stmt);
1380: END IF;
1381:
1382: EXECUTE IMMEDIATE p_select_stmt USING OUT p_deal_nos,
1383: OUT p_transaction_nos, OUT p_market_data_sets,

Line 1407: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NUMBER OF DEALS: ' || p_deal_nos.count);

1403:
1404: END IF;
1405: /*
1406: IF (g_proc_level>=g_debug_level) THEN
1407: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NUMBER OF DEALS: ' || p_deal_nos.count);
1408: END IF;
1409:
1410: FOR i IN 1..p_deal_nos.count LOOP
1411: IF (g_proc_level>=g_debug_level) THEN

Line 1412: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'd_no: '||p_deal_nos(i)||'; t_no: '||p_transaction_nos(i)||'; type: '||p_deal_types(i)||'; end date: '||p_end_dates(i));

1408: END IF;
1409:
1410: FOR i IN 1..p_deal_nos.count LOOP
1411: IF (g_proc_level>=g_debug_level) THEN
1412: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'd_no: '||p_deal_nos(i)||'; t_no: '||p_transaction_nos(i)||'; type: '||p_deal_types(i)||'; end date: '||p_end_dates(i));
1413: END IF;
1414: END LOOP;
1415: */
1416:

Line 1419: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'Gap Analysis');

1415: */
1416:
1417: ELSIF (p_settings.analysis_type ='G') THEN -- gap analysis
1418: IF (g_proc_level>=g_debug_level) THEN
1419: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'Gap Analysis');
1420: END IF;
1421: -- cannot filter based on gap date, since haven't calculated yet
1422: p_appended_where := p_appended_where ||' AND DEAL_TYPE <> ''STOCK''';
1423: p_select_stmt := p_select_stmt||p_appended_where||p_filter_where_clause;

Line 1430: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'select stmt: ', p_select_stmt);

1426: /*
1427: p_select_stmt := 'BEGIN '||p_select_stmt||';END;';
1428:
1429: IF (g_proc_level>=g_debug_level) THEN
1430: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'select stmt: ', p_select_stmt);
1431: END IF;
1432:
1433: EXECUTE IMMEDIATE p_select_stmt USING OUT p_deal_nos,
1434: OUT p_transaction_nos, OUT p_market_data_sets,

Line 1456: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'd_no: '||p_deal_nos(i)||'; t_no: '||p_transaction_nos(i)||'; type: '||p_deal_types(i)||'; end date: '||p_end_dates(i));

1452: OUT p_rounding_type, OUT p_day_count_type, OUT p_prepaid_interests;
1453:
1454: FOR i IN 1..p_deal_nos.count LOOP
1455: IF (g_proc_level>=g_debug_level) THEN
1456: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'd_no: '||p_deal_nos(i)||'; t_no: '||p_transaction_nos(i)||'; type: '||p_deal_types(i)||'; end date: '||p_end_dates(i));
1457: END IF;
1458: END LOOP;
1459: */
1460: END IF;

Line 1465: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'select stmt: ', p_select_stmt);

1461:
1462:
1463: -- BUG 2945198 - sql bind
1464: IF (g_proc_level>=g_debug_level) THEN
1465: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'select stmt: ', p_select_stmt);
1466: END IF;
1467:
1468: for p_filter_bindings in get_filter_bindings(p_settings.filter_name) loop
1469: dbms_sql.bind_variable(v_cursor,':'||to_char(p_filter_bindings.row_number),p_filter_bindings.value);

Line 1585: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'made it past select statement');

1581:
1582:
1583: /*
1584: IF (g_proc_level>=g_debug_level) THEN
1585: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'made it past select statement');
1586: END IF;
1587: IF (p_deal_nos.COUNT = 0) THEN
1588: retcode := '5';
1589: END IF;

Line 1594: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NO OF ROWS RETRIEVED: '||p_deal_nos.count);

1590:
1591: FOR i IN 1..p_deal_nos.count LOOP -- extend the temp tables
1592: */
1593: IF (g_proc_level>=g_debug_level) THEN
1594: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NO OF ROWS RETRIEVED: '||p_deal_nos.count);
1595: FOR i IN 1..n_num_rows_fetched LOOP
1596: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'd_no: '||p_deal_nos(i)||'; t_no: '||p_transaction_nos(i)||'; type: '||p_deal_types(i)||'; end date: '||p_end_dates(i));
1597: END LOOP;
1598: END IF;

Line 1596: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'd_no: '||p_deal_nos(i)||'; t_no: '||p_transaction_nos(i)||'; type: '||p_deal_types(i)||'; end date: '||p_end_dates(i));

1592: */
1593: IF (g_proc_level>=g_debug_level) THEN
1594: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NO OF ROWS RETRIEVED: '||p_deal_nos.count);
1595: FOR i IN 1..n_num_rows_fetched LOOP
1596: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'd_no: '||p_deal_nos(i)||'; t_no: '||p_transaction_nos(i)||'; type: '||p_deal_types(i)||'; end date: '||p_end_dates(i));
1597: END LOOP;
1598: END IF;
1599:
1600:

Line 1929: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'ref datetime', p_ref_datetime);

1925: -- reval rate, and volatility
1926: p_threshold_date := get_threshold_date(p_ref_datetime,
1927: p_settings.threshold_num, p_settings.threshold_type);
1928: IF (g_proc_level>=g_debug_level) THEN
1929: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'ref datetime', p_ref_datetime);
1930: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'threshold date', p_threshold_date);
1931: END IF;
1932: -- check to see if deal has been calculated previously
1933: OPEN deal_calculated(p_deal_nos(i), p_transaction_nos(i),

Line 1930: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'threshold date', p_threshold_date);

1926: p_threshold_date := get_threshold_date(p_ref_datetime,
1927: p_settings.threshold_num, p_settings.threshold_type);
1928: IF (g_proc_level>=g_debug_level) THEN
1929: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'ref datetime', p_ref_datetime);
1930: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'threshold date', p_threshold_date);
1931: END IF;
1932: -- check to see if deal has been calculated previously
1933: OPEN deal_calculated(p_deal_nos(i), p_transaction_nos(i),
1934: p_market_data_set_temp(i));

Line 1938: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'previously calculated: '||p_deal_nos(i));

1934: p_market_data_set_temp(i));
1935: FETCH deal_calculated INTO p_deal_calculations;
1936: IF (deal_calculated%FOUND) THEN -- deal previously calculated
1937: IF (g_proc_level>=g_debug_level) THEN
1938: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'previously calculated: '||p_deal_nos(i));
1939: END IF;
1940: OPEN deal_threshold_ok(p_deal_nos(i), p_transaction_nos(i),
1941: p_market_data_set_temp(i), p_threshold_date);
1942: FETCH deal_threshold_ok INTO p_deal_calc_id;

Line 1945: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'doesnt meet threshold, need to update');

1941: p_market_data_set_temp(i), p_threshold_date);
1942: FETCH deal_threshold_ok INTO p_deal_calc_id;
1943: IF (deal_threshold_ok%NOTFOUND) THEN -- but doesn't meet threshold
1944: IF (g_proc_level>=g_debug_level) THEN
1945: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'doesnt meet threshold, need to update');
1946: END IF;
1947: p_insert_or_update := 'U'; -- update calculations
1948: ELSE
1949: IF (g_proc_level>=g_debug_level) THEN

Line 1950: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'threshold met');

1946: END IF;
1947: p_insert_or_update := 'U'; -- update calculations
1948: ELSE
1949: IF (g_proc_level>=g_debug_level) THEN
1950: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'threshold met');
1951: END IF;
1952: p_insert_or_update := 'N'; -- threshold met, do nothing
1953: p_threshold_counter := p_threshold_counter + 1;
1954: END IF;

Line 1958: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'never calculated before: '||p_deal_nos(i));

1954: END IF;
1955: CLOSE deal_threshold_ok;
1956: ELSE -- deal not previously calculated
1957: IF (g_proc_level>=g_debug_level) THEN
1958: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'never calculated before: '||p_deal_nos(i));
1959: END IF;
1960: p_insert_or_update := 'I'; -- insert deal calculations
1961: END IF;
1962: CLOSE deal_calculated;

Line 1986: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'deal no: '||p_deal_nos(i));

1982: p_gap_date_temp(i) := p_gap_dates(i);
1983: END IF;
1984: END IF;
1985: IF (g_proc_level>=g_debug_level) THEN
1986: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'deal no: '||p_deal_nos(i));
1987: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'calculated Gap Date', p_gap_date_temp(i));
1988: END IF;
1989:
1990: p_gap_req_ok := TRUE; -- assume deal passes gap analysis requirements

Line 1987: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'calculated Gap Date', p_gap_date_temp(i));

1983: END IF;
1984: END IF;
1985: IF (g_proc_level>=g_debug_level) THEN
1986: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'deal no: '||p_deal_nos(i));
1987: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'calculated Gap Date', p_gap_date_temp(i));
1988: END IF;
1989:
1990: p_gap_req_ok := TRUE; -- assume deal passes gap analysis requirements
1991: -- If Gap Analysis, use calculated gap date to further filter

Line 2005: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'passed gap date test');

2001: END IF;
2002:
2003: IF (p_gap_req_ok) THEN -- passed gap date test
2004: IF (g_proc_level>=g_debug_level) THEN
2005: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'passed gap date test');
2006: END IF;
2007:
2008: p_gap_deal_exists := TRUE;
2009: p_temp_counter := p_temp_counter + 1;

Line 2025: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'sob ccy: ' || p_sob_ccy_temp(i));

2021: OPEN get_sob_ccy(p_company_codes(i));
2022: FETCH get_sob_ccy INTO p_sob_ccy_temp(i);
2023: CLOSE get_sob_ccy;
2024: IF (g_proc_level>=g_debug_level) THEN
2025: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'sob ccy: ' || p_sob_ccy_temp(i));
2026: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'STARTING CALCULATION FOR deal no: '||p_deal_nos(i)||', trans no: '||p_transaction_nos(i));
2027: END IF;
2028: -- get day count and annual basis set up first
2029: days_run_helper(p_ref_date, p_end_dates(i),

Line 2026: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'STARTING CALCULATION FOR deal no: '||p_deal_nos(i)||', trans no: '||p_transaction_nos(i));

2022: FETCH get_sob_ccy INTO p_sob_ccy_temp(i);
2023: CLOSE get_sob_ccy;
2024: IF (g_proc_level>=g_debug_level) THEN
2025: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'sob ccy: ' || p_sob_ccy_temp(i));
2026: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'STARTING CALCULATION FOR deal no: '||p_deal_nos(i)||', trans no: '||p_transaction_nos(i));
2027: END IF;
2028: -- get day count and annual basis set up first
2029: days_run_helper(p_ref_date, p_end_dates(i),
2030: p_day_count_bases(i), NULL, p_day_count, p_annual_basis);

Line 2035: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'end date: '||p_end_dates(i)||',ref_date: '||p_ref_date||', days: '||p_days_temp(i));

2031:
2032: -- calculate days from ref date to end date, days to maturity
2033: p_days_temp(i) := NVL(p_end_dates(i), p_ref_date+1) - p_ref_date;
2034: IF (g_proc_level>=g_debug_level) THEN
2035: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'end date: '||p_end_dates(i)||',ref_date: '||p_ref_date||', days: '||p_days_temp(i));
2036: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'market data set is: '||p_market_data_set_temp(i));
2037: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'pricing model is: '||p_pricing_models(i));
2038: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'deal type still: '||p_deal_types(i));
2039: END IF;

Line 2036: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'market data set is: '||p_market_data_set_temp(i));

2032: -- calculate days from ref date to end date, days to maturity
2033: p_days_temp(i) := NVL(p_end_dates(i), p_ref_date+1) - p_ref_date;
2034: IF (g_proc_level>=g_debug_level) THEN
2035: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'end date: '||p_end_dates(i)||',ref_date: '||p_ref_date||', days: '||p_days_temp(i));
2036: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'market data set is: '||p_market_data_set_temp(i));
2037: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'pricing model is: '||p_pricing_models(i));
2038: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'deal type still: '||p_deal_types(i));
2039: END IF;
2040:

Line 2037: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'pricing model is: '||p_pricing_models(i));

2033: p_days_temp(i) := NVL(p_end_dates(i), p_ref_date+1) - p_ref_date;
2034: IF (g_proc_level>=g_debug_level) THEN
2035: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'end date: '||p_end_dates(i)||',ref_date: '||p_ref_date||', days: '||p_days_temp(i));
2036: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'market data set is: '||p_market_data_set_temp(i));
2037: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'pricing model is: '||p_pricing_models(i));
2038: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'deal type still: '||p_deal_types(i));
2039: END IF;
2040:
2041: IF (p_deal_types(i) IN ('FX', 'FXO')) THEN

Line 2038: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'deal type still: '||p_deal_types(i));

2034: IF (g_proc_level>=g_debug_level) THEN
2035: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'end date: '||p_end_dates(i)||',ref_date: '||p_ref_date||', days: '||p_days_temp(i));
2036: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'market data set is: '||p_market_data_set_temp(i));
2037: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'pricing model is: '||p_pricing_models(i));
2038: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'deal type still: '||p_deal_types(i));
2039: END IF;
2040:
2041: IF (p_deal_types(i) IN ('FX', 'FXO')) THEN
2042: -- transaction rates

Line 2171: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'base int rate is:' ||p_gk_in.p_rate_for);

2167: p_gk_in.p_compound_freq_for := 1;
2168: END IF;
2169: p_gk_in.p_day_count_basis_for := p_fxo_day_count_basis;
2170: IF (g_proc_level>=g_debug_level) THEN
2171: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'base int rate is:' ||p_gk_in.p_rate_for);
2172: END IF;
2173: -- get domestic ccy int rate
2174: -- XTR_RISK_DEBUG_PKG.dlog('calculating fxo domestic int rate');
2175: p_md_in.p_ccy := p_domestic_ccys(i);

Line 2174: -- XTR_RISK_DEBUG_PKG.dlog('calculating fxo domestic int rate');

2170: IF (g_proc_level>=g_debug_level) THEN
2171: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'base int rate is:' ||p_gk_in.p_rate_for);
2172: END IF;
2173: -- get domestic ccy int rate
2174: -- XTR_RISK_DEBUG_PKG.dlog('calculating fxo domestic int rate');
2175: p_md_in.p_ccy := p_domestic_ccys(i);
2176: XTR_MARKET_DATA_P.get_md_from_set(p_md_in, p_md_out);
2177: p_gk_in.p_rate_dom := p_md_out.p_md_out;
2178: IF (within_one_year(p_ref_date, p_end_dates(i))) THEN

Line 2186: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'contra int rate:' ||p_gk_in.p_rate_dom);

2182: p_gk_in.p_compound_freq_dom := 1;
2183: END IF;
2184: p_gk_in.p_day_count_basis_dom := p_fxo_day_count_basis;
2185: IF (g_proc_level>=g_debug_level) THEN
2186: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'contra int rate:' ||p_gk_in.p_rate_dom);
2187: END IF;
2188: -- get spot rate
2189: -- XTR_RISK_DEBUG_PKG.dlog('calculating fxo spot rate');
2190: p_md_in.p_indicator := 'S';

Line 2189: -- XTR_RISK_DEBUG_PKG.dlog('calculating fxo spot rate');

2185: IF (g_proc_level>=g_debug_level) THEN
2186: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'contra int rate:' ||p_gk_in.p_rate_dom);
2187: END IF;
2188: -- get spot rate
2189: -- XTR_RISK_DEBUG_PKG.dlog('calculating fxo spot rate');
2190: p_md_in.p_indicator := 'S';
2191: p_md_in.p_ccy := p_foreign_ccys(i);
2192: p_md_in.p_contra_ccy := p_domestic_ccys(i);
2193: XTR_MARKET_DATA_P.get_md_from_set(p_md_in, p_md_out);

Line 2196: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'fxo spot rate:'||p_gk_in.p_spot_rate);

2192: p_md_in.p_contra_ccy := p_domestic_ccys(i);
2193: XTR_MARKET_DATA_P.get_md_from_set(p_md_in, p_md_out);
2194: p_gk_in.p_spot_rate := p_md_out.p_md_out;
2195: IF (g_proc_level>=g_debug_level) THEN
2196: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'fxo spot rate:'||p_gk_in.p_spot_rate);
2197: END IF;
2198: -- get volatility
2199: -- XTR_RISK_DEBUG_PKG.dlog('calculating fxo volatility');
2200: p_md_in.p_indicator := 'V';

Line 2199: -- XTR_RISK_DEBUG_PKG.dlog('calculating fxo volatility');

2195: IF (g_proc_level>=g_debug_level) THEN
2196: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'fxo spot rate:'||p_gk_in.p_spot_rate);
2197: END IF;
2198: -- get volatility
2199: -- XTR_RISK_DEBUG_PKG.dlog('calculating fxo volatility');
2200: p_md_in.p_indicator := 'V';
2201: XTR_MARKET_DATA_P.get_md_from_set(p_md_in, p_md_out);
2202: p_volatility_temp(i) := p_md_out.p_md_out;
2203:

Line 2207: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'fxo volatility:'||p_gk_in.p_volatility);

2203:
2204: p_gk_in.p_volatility := p_md_out.p_md_out;
2205: p_gk_in.p_strike_rate := p_transaction_rates(i);
2206: IF (g_proc_level>=g_debug_level) THEN
2207: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'fxo volatility:'||p_gk_in.p_volatility);
2208: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'fxo strike rate:'||p_gk_in.p_strike_rate);
2209: END IF;
2210: QRM_FX_FORMULAS.fx_gk_option_sens_cv(p_gk_in, p_gk_out);
2211: IF (p_calls_or_puts(i)='C') THEN

Line 2208: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'fxo strike rate:'||p_gk_in.p_strike_rate);

2204: p_gk_in.p_volatility := p_md_out.p_md_out;
2205: p_gk_in.p_strike_rate := p_transaction_rates(i);
2206: IF (g_proc_level>=g_debug_level) THEN
2207: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'fxo volatility:'||p_gk_in.p_volatility);
2208: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'fxo strike rate:'||p_gk_in.p_strike_rate);
2209: END IF;
2210: QRM_FX_FORMULAS.fx_gk_option_sens_cv(p_gk_in, p_gk_out);
2211: IF (p_calls_or_puts(i)='C') THEN
2212: p_delta_temp(i) := p_gk_out.p_delta_call;

Line 2225: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'deal no: '||p_deal_nos(i));

2221: END IF;
2222: p_gamma_temp(i) := p_gk_out.p_gamma;
2223: p_vega_temp(i) := p_gk_out.p_vega;
2224: IF (g_proc_level>=g_debug_level) THEN
2225: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'deal no: '||p_deal_nos(i));
2226: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'reval rate: '||p_fx_reval_rate_temp(i));
2227: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'fxo fair value: '||p_fair_value_temp(i));
2228: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'delta: '||p_delta_temp(i));
2229: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'theta: '||p_theta_temp(i));

Line 2226: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'reval rate: '||p_fx_reval_rate_temp(i));

2222: p_gamma_temp(i) := p_gk_out.p_gamma;
2223: p_vega_temp(i) := p_gk_out.p_vega;
2224: IF (g_proc_level>=g_debug_level) THEN
2225: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'deal no: '||p_deal_nos(i));
2226: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'reval rate: '||p_fx_reval_rate_temp(i));
2227: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'fxo fair value: '||p_fair_value_temp(i));
2228: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'delta: '||p_delta_temp(i));
2229: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'theta: '||p_theta_temp(i));
2230: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'rho for: '||p_rho_for_temp(i));

Line 2227: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'fxo fair value: '||p_fair_value_temp(i));

2223: p_vega_temp(i) := p_gk_out.p_vega;
2224: IF (g_proc_level>=g_debug_level) THEN
2225: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'deal no: '||p_deal_nos(i));
2226: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'reval rate: '||p_fx_reval_rate_temp(i));
2227: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'fxo fair value: '||p_fair_value_temp(i));
2228: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'delta: '||p_delta_temp(i));
2229: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'theta: '||p_theta_temp(i));
2230: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'rho for: '||p_rho_for_temp(i));
2231: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'rho dom: '||p_rho_dom_temp(i));

Line 2228: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'delta: '||p_delta_temp(i));

2224: IF (g_proc_level>=g_debug_level) THEN
2225: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'deal no: '||p_deal_nos(i));
2226: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'reval rate: '||p_fx_reval_rate_temp(i));
2227: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'fxo fair value: '||p_fair_value_temp(i));
2228: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'delta: '||p_delta_temp(i));
2229: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'theta: '||p_theta_temp(i));
2230: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'rho for: '||p_rho_for_temp(i));
2231: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'rho dom: '||p_rho_dom_temp(i));
2232: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'gamma: '||p_gamma_temp(i));

Line 2229: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'theta: '||p_theta_temp(i));

2225: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'deal no: '||p_deal_nos(i));
2226: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'reval rate: '||p_fx_reval_rate_temp(i));
2227: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'fxo fair value: '||p_fair_value_temp(i));
2228: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'delta: '||p_delta_temp(i));
2229: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'theta: '||p_theta_temp(i));
2230: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'rho for: '||p_rho_for_temp(i));
2231: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'rho dom: '||p_rho_dom_temp(i));
2232: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'gamma: '||p_gamma_temp(i));
2233: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'vega: '||p_vega_temp(i));

Line 2230: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'rho for: '||p_rho_for_temp(i));

2226: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'reval rate: '||p_fx_reval_rate_temp(i));
2227: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'fxo fair value: '||p_fair_value_temp(i));
2228: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'delta: '||p_delta_temp(i));
2229: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'theta: '||p_theta_temp(i));
2230: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'rho for: '||p_rho_for_temp(i));
2231: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'rho dom: '||p_rho_dom_temp(i));
2232: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'gamma: '||p_gamma_temp(i));
2233: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'vega: '||p_vega_temp(i));
2234: END IF;

Line 2231: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'rho dom: '||p_rho_dom_temp(i));

2227: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'fxo fair value: '||p_fair_value_temp(i));
2228: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'delta: '||p_delta_temp(i));
2229: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'theta: '||p_theta_temp(i));
2230: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'rho for: '||p_rho_for_temp(i));
2231: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'rho dom: '||p_rho_dom_temp(i));
2232: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'gamma: '||p_gamma_temp(i));
2233: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'vega: '||p_vega_temp(i));
2234: END IF;
2235:

Line 2232: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'gamma: '||p_gamma_temp(i));

2228: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'delta: '||p_delta_temp(i));
2229: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'theta: '||p_theta_temp(i));
2230: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'rho for: '||p_rho_for_temp(i));
2231: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'rho dom: '||p_rho_dom_temp(i));
2232: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'gamma: '||p_gamma_temp(i));
2233: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'vega: '||p_vega_temp(i));
2234: END IF;
2235:
2236: -- position delta in domestic ccy (default)

Line 2233: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'vega: '||p_vega_temp(i));

2229: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'theta: '||p_theta_temp(i));
2230: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'rho for: '||p_rho_for_temp(i));
2231: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'rho dom: '||p_rho_dom_temp(i));
2232: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'gamma: '||p_gamma_temp(i));
2233: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'vega: '||p_vega_temp(i));
2234: END IF;
2235:
2236: -- position delta in domestic ccy (default)
2237: p_pos_delta_temp(i) := p_delta_temp(i)*

Line 2519: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'base spot rate bid: '||p_spot_rate_a_bid);

2515: p_spot_rate_a_ask := p_md_out.p_md_out;
2516: END IF;
2517:
2518: IF (g_proc_level>=g_debug_level) THEN
2519: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'base spot rate bid: '||p_spot_rate_a_bid);
2520: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'base spot rate ask: '||p_spot_rate_a_ask);
2521: END IF;
2522: -- spot rate: contra ccy vs.usd
2523: IF (p_contra_ccys(i) = 'USD') THEN

Line 2520: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'base spot rate ask: '||p_spot_rate_a_ask);

2516: END IF;
2517:
2518: IF (g_proc_level>=g_debug_level) THEN
2519: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'base spot rate bid: '||p_spot_rate_a_bid);
2520: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'base spot rate ask: '||p_spot_rate_a_ask);
2521: END IF;
2522: -- spot rate: contra ccy vs.usd
2523: IF (p_contra_ccys(i) = 'USD') THEN
2524: p_spot_rate_b_bid := 1;

Line 2539: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'contra spot rate bid: '||p_spot_rate_b_bid);

2535: p_spot_rate_b_ask := p_md_out.p_md_out;
2536: END IF;
2537:
2538: IF (g_proc_level>=g_debug_level) THEN
2539: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'contra spot rate bid: '||p_spot_rate_b_bid);
2540: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'contra spot rate ask: '||p_spot_rate_b_ask);
2541: END IF;
2542:
2543: IF (p_insert_or_update <> 'N') THEN

Line 2540: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'contra spot rate ask: '||p_spot_rate_b_ask);

2536: END IF;
2537:
2538: IF (g_proc_level>=g_debug_level) THEN
2539: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'contra spot rate bid: '||p_spot_rate_b_bid);
2540: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'contra spot rate ask: '||p_spot_rate_b_ask);
2541: END IF;
2542:
2543: IF (p_insert_or_update <> 'N') THEN
2544: -- FAIR VALUE of FX deal

Line 2564: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FX deal no: '||p_deal_nos(i));

2560: p_sob_ccy_temp(i), 'USD', p_fair_value_temp(i),
2561: p_fair_value_usd_temp(i));
2562: END IF;
2563: IF (g_proc_level>=g_debug_level) THEN
2564: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FX deal no: '||p_deal_nos(i));
2565: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FX reval rate: '||p_fx_reval_rate_temp(i));
2566: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FX fair value is: '||p_fair_value_temp(i));
2567: END IF;
2568:

Line 2565: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FX reval rate: '||p_fx_reval_rate_temp(i));

2561: p_fair_value_usd_temp(i));
2562: END IF;
2563: IF (g_proc_level>=g_debug_level) THEN
2564: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FX deal no: '||p_deal_nos(i));
2565: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FX reval rate: '||p_fx_reval_rate_temp(i));
2566: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FX fair value is: '||p_fair_value_temp(i));
2567: END IF;
2568:
2569: -- ** FX SENSITIVITIES ** --

Line 2566: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FX fair value is: '||p_fair_value_temp(i));

2562: END IF;
2563: IF (g_proc_level>=g_debug_level) THEN
2564: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FX deal no: '||p_deal_nos(i));
2565: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FX reval rate: '||p_fx_reval_rate_temp(i));
2566: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FX fair value is: '||p_fair_value_temp(i));
2567: END IF;
2568:
2569: -- ** FX SENSITIVITIES ** --
2570: -- delta spot

Line 2584: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'base int rate bid: '||p_int_rate_a_bid);

2580: END IF;
2581: -- Rho Base/Contra
2582: -- Rho Contra bid/ask
2583: IF (g_proc_level>=g_debug_level) THEN
2584: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'base int rate bid: '||p_int_rate_a_bid);
2585: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'base int rate ask: '||p_int_rate_a_ask);
2586: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'contra int rate bid: '||p_int_rate_b_bid);
2587: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'contra int rate ask: '||p_int_rate_b_ask);
2588: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'usd int rate bid: '||p_int_rate_c_bid);

Line 2585: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'base int rate ask: '||p_int_rate_a_ask);

2581: -- Rho Base/Contra
2582: -- Rho Contra bid/ask
2583: IF (g_proc_level>=g_debug_level) THEN
2584: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'base int rate bid: '||p_int_rate_a_bid);
2585: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'base int rate ask: '||p_int_rate_a_ask);
2586: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'contra int rate bid: '||p_int_rate_b_bid);
2587: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'contra int rate ask: '||p_int_rate_b_ask);
2588: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'usd int rate bid: '||p_int_rate_c_bid);
2589: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'usd int rate ask: '||p_int_rate_c_ask);

Line 2586: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'contra int rate bid: '||p_int_rate_b_bid);

2582: -- Rho Contra bid/ask
2583: IF (g_proc_level>=g_debug_level) THEN
2584: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'base int rate bid: '||p_int_rate_a_bid);
2585: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'base int rate ask: '||p_int_rate_a_ask);
2586: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'contra int rate bid: '||p_int_rate_b_bid);
2587: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'contra int rate ask: '||p_int_rate_b_ask);
2588: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'usd int rate bid: '||p_int_rate_c_bid);
2589: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'usd int rate ask: '||p_int_rate_c_ask);
2590: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'day count: '||p_day_count);

Line 2587: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'contra int rate ask: '||p_int_rate_b_ask);

2583: IF (g_proc_level>=g_debug_level) THEN
2584: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'base int rate bid: '||p_int_rate_a_bid);
2585: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'base int rate ask: '||p_int_rate_a_ask);
2586: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'contra int rate bid: '||p_int_rate_b_bid);
2587: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'contra int rate ask: '||p_int_rate_b_ask);
2588: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'usd int rate bid: '||p_int_rate_c_bid);
2589: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'usd int rate ask: '||p_int_rate_c_ask);
2590: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'day count: '||p_day_count);
2591: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'annual basis: '||p_annual_basis);

Line 2588: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'usd int rate bid: '||p_int_rate_c_bid);

2584: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'base int rate bid: '||p_int_rate_a_bid);
2585: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'base int rate ask: '||p_int_rate_a_ask);
2586: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'contra int rate bid: '||p_int_rate_b_bid);
2587: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'contra int rate ask: '||p_int_rate_b_ask);
2588: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'usd int rate bid: '||p_int_rate_c_bid);
2589: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'usd int rate ask: '||p_int_rate_c_ask);
2590: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'day count: '||p_day_count);
2591: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'annual basis: '||p_annual_basis);
2592: END IF;

Line 2589: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'usd int rate ask: '||p_int_rate_c_ask);

2585: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'base int rate ask: '||p_int_rate_a_ask);
2586: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'contra int rate bid: '||p_int_rate_b_bid);
2587: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'contra int rate ask: '||p_int_rate_b_ask);
2588: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'usd int rate bid: '||p_int_rate_c_bid);
2589: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'usd int rate ask: '||p_int_rate_c_ask);
2590: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'day count: '||p_day_count);
2591: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'annual basis: '||p_annual_basis);
2592: END IF;
2593:

Line 2590: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'day count: '||p_day_count);

2586: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'contra int rate bid: '||p_int_rate_b_bid);
2587: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'contra int rate ask: '||p_int_rate_b_ask);
2588: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'usd int rate bid: '||p_int_rate_c_bid);
2589: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'usd int rate ask: '||p_int_rate_c_ask);
2590: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'day count: '||p_day_count);
2591: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'annual basis: '||p_annual_basis);
2592: END IF;
2593:
2594: p_deltas_rhos := QRM_FX_FORMULAS.fx_forward_rho('D',

Line 2591: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'annual basis: '||p_annual_basis);

2587: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'contra int rate ask: '||p_int_rate_b_ask);
2588: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'usd int rate bid: '||p_int_rate_c_bid);
2589: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'usd int rate ask: '||p_int_rate_c_ask);
2590: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'day count: '||p_day_count);
2591: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'annual basis: '||p_annual_basis);
2592: END IF;
2593:
2594: p_deltas_rhos := QRM_FX_FORMULAS.fx_forward_rho('D',
2595: p_spot_rate_a_bid, p_spot_rate_a_ask,

Line 2697: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'calculating bond!');

2693: END IF; -- end if fxo
2694:
2695: ELSIF (p_deal_types(i)='BOND') THEN -- BOND
2696: IF (g_proc_level>=g_debug_level) THEN
2697: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'calculating bond!');
2698: END IF;
2699: p_maturity_amount_temp(i):=get_signed_amount(p_face_values(i),
2700: p_deal_types(i), p_deal_subtypes(i), null);
2701: p_gap_amount_temp(i) := p_maturity_amount_temp(i);

Line 2756: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'ric code does not exist');

2752: IF (get_bond_code%NOTFOUND) THEN
2753: -- settings bond code to null will cause
2754: -- cause api's to throw no data found exception
2755: IF (g_proc_level>=g_debug_level) THEN
2756: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'ric code does not exist');
2757: END IF;
2758: p_bond_code := null;
2759: END IF;
2760: CLOSE get_bond_code;

Line 2778: xtr_risk_debug_pkg.dlog('run_analysis: ' || 'insert/update val: '||p_insert_or_update);

2774: p_coupon_rates(i) := 0;
2775: END IF;
2776:
2777: IF (g_proc_level>=g_debug_level) THEN
2778: xtr_risk_debug_pkg.dlog('run_analysis: ' || 'insert/update val: '||p_insert_or_update);
2779: END IF;
2780: IF (p_insert_or_update <> 'N') THEN
2781: p_mm_reval_rate_temp(i):= null;
2782: -- calculates fair value, data side, reval rate

Line 2853: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date: '||coupon_rec.start_date);

2849: END IF;
2850: */
2851:
2852: IF (g_proc_level>=g_debug_level) THEN
2853: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date: '||coupon_rec.start_date);
2854: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'maturity date: '||coupon_rec.maturity_date);
2855: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'coupon amt: '||p_cashflows(p_counter));
2856: END IF;
2857: p_days.EXTEND;

Line 2854: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'maturity date: '||coupon_rec.maturity_date);

2850: */
2851:
2852: IF (g_proc_level>=g_debug_level) THEN
2853: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date: '||coupon_rec.start_date);
2854: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'maturity date: '||coupon_rec.maturity_date);
2855: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'coupon amt: '||p_cashflows(p_counter));
2856: END IF;
2857: p_days.EXTEND;
2858: -- calculate number of days until next cashflow

Line 2855: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'coupon amt: '||p_cashflows(p_counter));

2851:
2852: IF (g_proc_level>=g_debug_level) THEN
2853: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'start date: '||coupon_rec.start_date);
2854: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'maturity date: '||coupon_rec.maturity_date);
2855: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'coupon amt: '||p_cashflows(p_counter));
2856: END IF;
2857: p_days.EXTEND;
2858: -- calculate number of days until next cashflow
2859: days_run_helper(p_ref_date,

Line 2865: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'day count basis: '||p_day_count_bases(i));

2861: null, p_days(p_counter), p_annual_basis);
2862:
2863:
2864: IF (g_proc_level>=g_debug_level) THEN
2865: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'day count basis: '||p_day_count_bases(i));
2866: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'days to cashflow: '||p_days(p_counter));
2867: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'annual basis: '||p_annual_basis);
2868: END IF;
2869: XTR_RISK_DEBUG_PKG.dlog('year fraction: '||p_days(p_counter)/p_annual_basis);

Line 2866: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'days to cashflow: '||p_days(p_counter));

2862:
2863:
2864: IF (g_proc_level>=g_debug_level) THEN
2865: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'day count basis: '||p_day_count_bases(i));
2866: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'days to cashflow: '||p_days(p_counter));
2867: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'annual basis: '||p_annual_basis);
2868: END IF;
2869: XTR_RISK_DEBUG_PKG.dlog('year fraction: '||p_days(p_counter)/p_annual_basis);
2870: p_bond_coupon_start := coupon_rec.start_date;

Line 2867: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'annual basis: '||p_annual_basis);

2863:
2864: IF (g_proc_level>=g_debug_level) THEN
2865: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'day count basis: '||p_day_count_bases(i));
2866: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'days to cashflow: '||p_days(p_counter));
2867: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'annual basis: '||p_annual_basis);
2868: END IF;
2869: XTR_RISK_DEBUG_PKG.dlog('year fraction: '||p_days(p_counter)/p_annual_basis);
2870: p_bond_coupon_start := coupon_rec.start_date;
2871: p_bond_coupon_end := coupon_rec.maturity_date;

Line 2869: XTR_RISK_DEBUG_PKG.dlog('year fraction: '||p_days(p_counter)/p_annual_basis);

2865: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'day count basis: '||p_day_count_bases(i));
2866: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'days to cashflow: '||p_days(p_counter));
2867: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'annual basis: '||p_annual_basis);
2868: END IF;
2869: XTR_RISK_DEBUG_PKG.dlog('year fraction: '||p_days(p_counter)/p_annual_basis);
2870: p_bond_coupon_start := coupon_rec.start_date;
2871: p_bond_coupon_end := coupon_rec.maturity_date;
2872:
2873: -- convert YTM to annual compounded formula

Line 2875: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'ytm: '||p_bond_ytm);

2871: p_bond_coupon_end := coupon_rec.maturity_date;
2872:
2873: -- convert YTM to annual compounded formula
2874: IF (g_proc_level>=g_debug_level) THEN
2875: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'ytm: '||p_bond_ytm);
2876: END IF;
2877: IF (p_coupon_freqs(i) <> 1) THEN
2878: p_rc_in.p_start_date := p_bond_coupon_start;
2879: p_rc_in.p_end_date := p_bond_coupon_end;

Line 2894: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'effective yield rate: '||p_yield_rate);

2890: p_yield_rate := p_bond_ytm;
2891: END IF;
2892:
2893: IF (g_proc_level>=g_debug_level) THEN
2894: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'effective yield rate: '||p_yield_rate);
2895: END IF;
2896: -- convert YTM to a long discount factor
2897: p_discount_factors.EXTEND;
2898: XTR_RATE_CONVERSION.yield_to_discount_factor_long(

Line 2903: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'discount factor: '||p_discount_factors(p_counter));

2899: p_yield_rate, p_days(p_counter), p_annual_basis,
2900: p_discount_factors(p_counter));
2901:
2902: IF (g_proc_level>=g_debug_level) THEN
2903: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'discount factor: '||p_discount_factors(p_counter));
2904: END IF;
2905:
2906: --start bug 2804548
2907: IF nvl(p_initial_bases(i),'FIXED')='FLOAT' THEN

Line 2963: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'last cashflow: '||p_cashflows(p_counter));

2959: END IF;
2960: */
2961:
2962: IF (g_proc_level>=g_debug_level) THEN
2963: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'last cashflow: '||p_cashflows(p_counter));
2964: END IF;
2965: days_run_helper(p_ref_date, p_end_dates(i),
2966: p_day_count_bases(i), null, p_days(p_counter),
2967: p_annual_basis);

Line 2969: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'last days: '||p_days(p_counter));

2965: days_run_helper(p_ref_date, p_end_dates(i),
2966: p_day_count_bases(i), null, p_days(p_counter),
2967: p_annual_basis);
2968: IF (g_proc_level>=g_debug_level) THEN
2969: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'last days: '||p_days(p_counter));
2970: END IF;
2971:
2972: p_discount_factors.EXTEND;
2973: XTR_RATE_CONVERSION.yield_to_discount_factor_long(

Line 2986: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'discount factor: '||p_discount_factors(p_counter));

2982: p_discount_factors_add1bp(p_counter));
2983: END IF;
2984:
2985: IF (g_proc_level>=g_debug_level) THEN
2986: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'discount factor: '||p_discount_factors(p_counter));
2987: END IF;
2988:
2989:
2990: IF (p_ref_date <> p_end_dates(i)) THEN

Line 3033: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'pv cashflow add1bp: '||p_cashflows(j));

3029: XTR_MM_COVERS.present_value(p_pv_in, p_pv_out);
3030: p_cashflows(j) := p_pv_out.p_present_val;
3031: p_tot_cf_add1bp := p_tot_cf_add1bp + p_cashflows(j);
3032: IF (g_proc_level>=g_debug_level) THEN
3033: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'pv cashflow add1bp: '||p_cashflows(j));
3034: END IF;
3035: END LOOP;
3036:
3037: p_bpv := (p_tot_cf_add1bp*100/p_face_values(i))-p_dirty_price;

Line 3044: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'dirty price: '||p_dirty_price);

3040: --end bug 2804548
3041:
3042: -- convexity
3043: IF (g_proc_level>=g_debug_level) THEN
3044: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'dirty price: '||p_dirty_price);
3045: END IF;
3046: p_convexity_temp(i) := QRM_MM_FORMULAS.bond_convexity(
3047: p_cashflows, p_days, p_coupon_freqs(i),
3048: p_bond_ytm, p_annual_basis, p_dirty_price);

Line 3054: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'total cashflows: '||p_cashflows.COUNT);

3050: p_convexity_temp(i) := p_convexity_temp(i)/
3051: p_signed_face_value*100;
3052:
3053: IF (g_proc_level>=g_debug_level) THEN
3054: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'total cashflows: '||p_cashflows.COUNT);
3055: END IF;
3056: -- convert cashflows to present values for duration
3057: -- convert cashflows to per 100 for convexity
3058:

Line 3075: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'pv cashflow: '||p_cashflows(j));

3071: END IF;
3072: XTR_MM_COVERS.present_value(p_pv_in, p_pv_out);
3073: p_cashflows(j) := p_pv_out.p_present_val;
3074: IF (g_proc_level>=g_debug_level) THEN
3075: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'pv cashflow: '||p_cashflows(j));
3076: END IF;
3077: END LOOP;
3078:
3079: -- duration

Line 3180: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'calculating stock');

3176: END IF;
3177:
3178: ELSIF (p_deal_types(i)='STOCK') THEN -- STOCK
3179: IF (g_proc_level>=g_debug_level) THEN
3180: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'calculating stock');
3181: END IF;
3182: p_maturity_amount_temp(i):=TO_NUMBER(NULL);
3183: p_gap_amount_temp(i) := TO_NUMBER(NULL);
3184:

Line 3198: xtr_risk_debug_pkg.dlog('run_analysis: ' || 'insert/update val: '||p_insert_or_update);

3194: p_trans_price_temp(i) := p_transaction_rates(i);
3195:
3196:
3197: IF (g_proc_level>=g_debug_level) THEN
3198: xtr_risk_debug_pkg.dlog('run_analysis: ' || 'insert/update val: '||p_insert_or_update);
3199: END IF;
3200: IF (p_insert_or_update <> 'N') THEN
3201: QRM_EQ_FORMULAS.fv_stock(p_pricing_models(i), p_deal_ccys(i),
3202: p_bond_issues(i), p_market_data_set_temp(i),

Line 3308: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI deal no: '||p_deal_nos(i));

3304: END IF;
3305: -- transaction rate, converted to Act/365
3306: IF (p_day_count_bases(i) <> p_mm_day_count_basis) THEN
3307: IF (g_proc_level>=g_debug_level) THEN
3308: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI deal no: '||p_deal_nos(i));
3309: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI start date: '||p_start_dates(i));
3310: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI mat date: '||p_maturity_dates(i));
3311: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'DCB in: '||p_day_count_bases(i));
3312: END IF;

Line 3309: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI start date: '||p_start_dates(i));

3305: -- transaction rate, converted to Act/365
3306: IF (p_day_count_bases(i) <> p_mm_day_count_basis) THEN
3307: IF (g_proc_level>=g_debug_level) THEN
3308: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI deal no: '||p_deal_nos(i));
3309: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI start date: '||p_start_dates(i));
3310: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI mat date: '||p_maturity_dates(i));
3311: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'DCB in: '||p_day_count_bases(i));
3312: END IF;
3313: p_rc_in.p_start_date := p_start_dates(i);

Line 3310: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI mat date: '||p_maturity_dates(i));

3306: IF (p_day_count_bases(i) <> p_mm_day_count_basis) THEN
3307: IF (g_proc_level>=g_debug_level) THEN
3308: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI deal no: '||p_deal_nos(i));
3309: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI start date: '||p_start_dates(i));
3310: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI mat date: '||p_maturity_dates(i));
3311: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'DCB in: '||p_day_count_bases(i));
3312: END IF;
3313: p_rc_in.p_start_date := p_start_dates(i);
3314: p_rc_in.p_end_date := p_end_dates(i);

Line 3311: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'DCB in: '||p_day_count_bases(i));

3307: IF (g_proc_level>=g_debug_level) THEN
3308: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI deal no: '||p_deal_nos(i));
3309: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI start date: '||p_start_dates(i));
3310: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI mat date: '||p_maturity_dates(i));
3311: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'DCB in: '||p_day_count_bases(i));
3312: END IF;
3313: p_rc_in.p_start_date := p_start_dates(i);
3314: p_rc_in.p_end_date := p_end_dates(i);
3315: p_rc_in.p_day_count_basis_in := p_day_count_bases(i);

Line 3327: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'trans rate in: '||p_transaction_rates(i));

3323: p_rc_in.p_compound_freq_in := 1;
3324: p_rc_in.p_compound_freq_out := 1;
3325: END IF;
3326: IF (g_proc_level>=g_debug_level) THEN
3327: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'trans rate in: '||p_transaction_rates(i));
3328: END IF;
3329: p_rc_in.p_rate_in := p_transaction_rates(i);
3330: rate_conversion(p_rc_in, p_rc_out);
3331: p_mm_trans_rate_temp(i) := p_rc_out.p_rate_out;

Line 3378: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'days to maturity: '||p_days(1));

3374: -- calculate days to maturity
3375: days_run_helper(p_ref_date, p_maturity_dates(i),
3376: p_day_count_bases(i), null, p_days(1), p_annual_basis);
3377: IF (g_proc_level>=g_debug_level) THEN
3378: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'days to maturity: '||p_days(1));
3379: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'days in year: '||p_annual_basis);
3380: END IF;
3381: p_duration_temp(i) := QRM_MM_FORMULAS.duration(NULL,
3382: p_days, p_annual_basis);

Line 3379: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'days in year: '||p_annual_basis);

3375: days_run_helper(p_ref_date, p_maturity_dates(i),
3376: p_day_count_bases(i), null, p_days(1), p_annual_basis);
3377: IF (g_proc_level>=g_debug_level) THEN
3378: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'days to maturity: '||p_days(1));
3379: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'days in year: '||p_annual_basis);
3380: END IF;
3381: p_duration_temp(i) := QRM_MM_FORMULAS.duration(NULL,
3382: p_days, p_annual_basis);
3383:

Line 3406: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'ytm in DCB: '|| p_yield_rate);

3402: ELSE
3403: p_yield_rate := p_mm_reval_rate_temp(i);
3404: END IF;
3405: IF (g_proc_level>=g_debug_level) THEN
3406: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'ytm in DCB: '|| p_yield_rate);
3407: END IF;
3408:
3409: -- yield to maturity is reval rate in deal DCB
3410: p_ytm_temp(i) := p_yield_rate;

Line 3475: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI deal no: '||p_deal_nos(i));

3471: p_pos_bpv_sob_temp(i) := p_deal_calculations.pos_bpv_sob;
3472: END IF; -- end threshold check for fv/sens calculations;
3473:
3474: IF (g_proc_level>=g_debug_level) THEN
3475: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI deal no: '||p_deal_nos(i));
3476: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI yield rate: '||p_yield_rate);
3477: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI fair value: '||p_fair_value_temp(i));
3478: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI duration: '||p_duration_temp(i));
3479: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI mod duration: '||p_mod_duration_temp(i));

Line 3476: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI yield rate: '||p_yield_rate);

3472: END IF; -- end threshold check for fv/sens calculations;
3473:
3474: IF (g_proc_level>=g_debug_level) THEN
3475: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI deal no: '||p_deal_nos(i));
3476: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI yield rate: '||p_yield_rate);
3477: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI fair value: '||p_fair_value_temp(i));
3478: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI duration: '||p_duration_temp(i));
3479: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI mod duration: '||p_mod_duration_temp(i));
3480: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI bpv: '||p_bpv);

Line 3477: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI fair value: '||p_fair_value_temp(i));

3473:
3474: IF (g_proc_level>=g_debug_level) THEN
3475: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI deal no: '||p_deal_nos(i));
3476: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI yield rate: '||p_yield_rate);
3477: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI fair value: '||p_fair_value_temp(i));
3478: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI duration: '||p_duration_temp(i));
3479: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI mod duration: '||p_mod_duration_temp(i));
3480: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI bpv: '||p_bpv);
3481: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI convexity: '||p_convexity_temp(i));

Line 3478: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI duration: '||p_duration_temp(i));

3474: IF (g_proc_level>=g_debug_level) THEN
3475: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI deal no: '||p_deal_nos(i));
3476: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI yield rate: '||p_yield_rate);
3477: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI fair value: '||p_fair_value_temp(i));
3478: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI duration: '||p_duration_temp(i));
3479: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI mod duration: '||p_mod_duration_temp(i));
3480: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI bpv: '||p_bpv);
3481: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI convexity: '||p_convexity_temp(i));
3482: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI reval rate: '||p_mm_reval_rate_temp(i));

Line 3479: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI mod duration: '||p_mod_duration_temp(i));

3475: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI deal no: '||p_deal_nos(i));
3476: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI yield rate: '||p_yield_rate);
3477: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI fair value: '||p_fair_value_temp(i));
3478: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI duration: '||p_duration_temp(i));
3479: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI mod duration: '||p_mod_duration_temp(i));
3480: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI bpv: '||p_bpv);
3481: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI convexity: '||p_convexity_temp(i));
3482: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI reval rate: '||p_mm_reval_rate_temp(i));
3483: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI trans rate: '||p_mm_trans_rate_temp(i));

Line 3480: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI bpv: '||p_bpv);

3476: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI yield rate: '||p_yield_rate);
3477: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI fair value: '||p_fair_value_temp(i));
3478: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI duration: '||p_duration_temp(i));
3479: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI mod duration: '||p_mod_duration_temp(i));
3480: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI bpv: '||p_bpv);
3481: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI convexity: '||p_convexity_temp(i));
3482: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI reval rate: '||p_mm_reval_rate_temp(i));
3483: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI trans rate: '||p_mm_trans_rate_temp(i));
3484: END IF;

Line 3481: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI convexity: '||p_convexity_temp(i));

3477: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI fair value: '||p_fair_value_temp(i));
3478: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI duration: '||p_duration_temp(i));
3479: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI mod duration: '||p_mod_duration_temp(i));
3480: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI bpv: '||p_bpv);
3481: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI convexity: '||p_convexity_temp(i));
3482: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI reval rate: '||p_mm_reval_rate_temp(i));
3483: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI trans rate: '||p_mm_trans_rate_temp(i));
3484: END IF;
3485:

Line 3482: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI reval rate: '||p_mm_reval_rate_temp(i));

3478: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI duration: '||p_duration_temp(i));
3479: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI mod duration: '||p_mod_duration_temp(i));
3480: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI bpv: '||p_bpv);
3481: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI convexity: '||p_convexity_temp(i));
3482: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI reval rate: '||p_mm_reval_rate_temp(i));
3483: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI trans rate: '||p_mm_trans_rate_temp(i));
3484: END IF;
3485:
3486: ELSIF (p_deal_types(i) IN ('TMM', 'IRS', 'RTMM')) THEN

Line 3483: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI trans rate: '||p_mm_trans_rate_temp(i));

3479: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI mod duration: '||p_mod_duration_temp(i));
3480: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI bpv: '||p_bpv);
3481: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI convexity: '||p_convexity_temp(i));
3482: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI reval rate: '||p_mm_reval_rate_temp(i));
3483: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI trans rate: '||p_mm_trans_rate_temp(i));
3484: END IF;
3485:
3486: ELSIF (p_deal_types(i) IN ('TMM', 'IRS', 'RTMM')) THEN
3487:

Line 3571: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'days until cashflow: '||p_days(p_counter));

3567: days_run_helper(p_ref_date,
3568: cursor_rec.maturity_date, p_day_count_bases(i), NULL,
3569: p_days(p_counter), p_annual_basis);
3570: IF (g_proc_level>=g_debug_level) THEN
3571: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'days until cashflow: '||p_days(p_counter));
3572: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'annual basis: '||p_annual_basis);
3573: END IF;
3574: p_trans_trans_nos.EXTEND;
3575: p_trans_trans_nos(p_counter) := cursor_rec.transaction_number;

Line 3572: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'annual basis: '||p_annual_basis);

3568: cursor_rec.maturity_date, p_day_count_bases(i), NULL,
3569: p_days(p_counter), p_annual_basis);
3570: IF (g_proc_level>=g_debug_level) THEN
3571: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'days until cashflow: '||p_days(p_counter));
3572: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'annual basis: '||p_annual_basis);
3573: END IF;
3574: p_trans_trans_nos.EXTEND;
3575: p_trans_trans_nos(p_counter) := cursor_rec.transaction_number;
3576: p_trans_start_dates.EXTEND;

Line 3692: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'TMM/IRS/RTMM fair value is: '||p_fair_value_temp(i));

3688: /* TMM,IRS,RTMM has no reval rate */
3689: p_mm_trans_rate_temp(i), p_accrued_interest_temp(i),
3690: p_fair_value_temp(i));
3691: IF (g_proc_level>=g_debug_level) THEN
3692: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'TMM/IRS/RTMM fair value is: '||p_fair_value_temp(i));
3693: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'TMM/IRS/RTMM accrued interest is: '||p_accrued_interest_temp(i));
3694: END IF;
3695:
3696:

Line 3693: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'TMM/IRS/RTMM accrued interest is: '||p_accrued_interest_temp(i));

3689: p_mm_trans_rate_temp(i), p_accrued_interest_temp(i),
3690: p_fair_value_temp(i));
3691: IF (g_proc_level>=g_debug_level) THEN
3692: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'TMM/IRS/RTMM fair value is: '||p_fair_value_temp(i));
3693: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'TMM/IRS/RTMM accrued interest is: '||p_accrued_interest_temp(i));
3694: END IF;
3695:
3696:
3697: -- convert fair value, accrued interest

Line 3725: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'before ref date check');

3721: p_accrued_interest_sob_temp(i));
3722: END IF;
3723:
3724: IF (g_proc_level>=g_debug_level) THEN
3725: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'before ref date check');
3726: END IF;
3727: IF (p_ref_date <> p_end_dates(i)) THEN
3728: -- duration
3729: IF (g_proc_level>=g_debug_level) THEN

Line 3730: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'inside ref date check');

3726: END IF;
3727: IF (p_ref_date <> p_end_dates(i)) THEN
3728: -- duration
3729: IF (g_proc_level>=g_debug_level) THEN
3730: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'inside ref date check');
3731: END IF;
3732: p_duration_temp(i) := QRM_MM_FORMULAS.duration(
3733: p_cashflows, p_days, p_annual_basis);
3734: IF (g_proc_level>=g_debug_level) THEN

Line 3735: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'duration is: '|| p_duration_temp(i));

3731: END IF;
3732: p_duration_temp(i) := QRM_MM_FORMULAS.duration(
3733: p_cashflows, p_days, p_annual_basis);
3734: IF (g_proc_level>=g_debug_level) THEN
3735: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'duration is: '|| p_duration_temp(i));
3736: END IF;
3737: -- Position BPV in deal ccy
3738: -- calculate fair value with yield curve + 1bp
3739: QRM_MM_FORMULAS.fv_tmm_irs_rtmm(p_pricing_models(i),

Line 3757: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'bp accrued int: '||p_dummy_num2);

3753: p_dummy_days, p_dummy_num1,
3754: p_dummy_num1, p_dummy_num2, p_fair_value_bp);
3755:
3756: IF (g_proc_level>=g_debug_level) THEN
3757: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'bp accrued int: '||p_dummy_num2);
3758: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'fair value bp: '||p_fair_value_bp);
3759: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'fair value: '||p_fair_value_temp(i));
3760: END IF;
3761:

Line 3758: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'fair value bp: '||p_fair_value_bp);

3754: p_dummy_num1, p_dummy_num2, p_fair_value_bp);
3755:
3756: IF (g_proc_level>=g_debug_level) THEN
3757: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'bp accrued int: '||p_dummy_num2);
3758: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'fair value bp: '||p_fair_value_bp);
3759: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'fair value: '||p_fair_value_temp(i));
3760: END IF;
3761:
3762: -- position bpv in deal ccy

Line 3759: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'fair value: '||p_fair_value_temp(i));

3755:
3756: IF (g_proc_level>=g_debug_level) THEN
3757: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'bp accrued int: '||p_dummy_num2);
3758: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'fair value bp: '||p_fair_value_bp);
3759: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'fair value: '||p_fair_value_temp(i));
3760: END IF;
3761:
3762: -- position bpv in deal ccy
3763: p_pos_bpv_temp(i) := p_fair_value_bp -

Line 3902: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA days to start: '||p_days(1));

3898: -- days to settle (start date)
3899: days_run_helper(p_ref_date, p_start_dates(i),
3900: p_day_count_bases(i), null, p_days(1), p_annual_basis);
3901: IF (g_proc_level>=g_debug_level) THEN
3902: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA days to start: '||p_days(1));
3903: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA annual basis: '||p_annual_basis);
3904: END IF;
3905: p_duration_temp(i) := QRM_MM_FORMULAS.duration(null,
3906: p_days, p_annual_basis);

Line 3903: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA annual basis: '||p_annual_basis);

3899: days_run_helper(p_ref_date, p_start_dates(i),
3900: p_day_count_bases(i), null, p_days(1), p_annual_basis);
3901: IF (g_proc_level>=g_debug_level) THEN
3902: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA days to start: '||p_days(1));
3903: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA annual basis: '||p_annual_basis);
3904: END IF;
3905: p_duration_temp(i) := QRM_MM_FORMULAS.duration(null,
3906: p_days, p_annual_basis);
3907:

Line 3932: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA price in deal DCB',p_fra_price);

3928: p_fra_price := p_mm_reval_rate_temp(i);
3929: END IF;
3930:
3931: IF (g_proc_level>=g_debug_level) THEN
3932: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA price in deal DCB',p_fra_price);
3933: END IF;
3934: p_convexity_temp(i) := QRM_MM_FORMULAS.ni_fra_convexity(
3935: p_days(1), p_fra_price, p_annual_basis);
3936:

Line 3947: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA fv bpv: '||p_fair_value_bp);

3943: p_face_values(i), p_transaction_rates(i),
3944: p_day_count_bases(i), p_side, p_fra_price,
3945: p_fair_value_bp);
3946: IF (g_proc_level>=g_debug_level) THEN
3947: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA fv bpv: '||p_fair_value_bp);
3948: END IF;
3949: p_pos_bpv_temp(i) := p_fair_value_bp - p_fair_value_temp(i);
3950:
3951: -- position bpv in usd ccy

Line 3993: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA deal no is: '||p_deal_nos(i));

3989: p_pos_bpv_sob_temp(i) := p_deal_calculations.pos_bpv_sob;
3990: END IF; -- end threshold check for fv/sens calculations
3991:
3992: IF (g_proc_level>=g_debug_level) THEN
3993: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA deal no is: '||p_deal_nos(i));
3994: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA fair value is: '||p_fair_value_temp(i));
3995: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA reval rate ACT365 is: '||p_mm_reval_rate_temp(i));
3996: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA trans rate ACT365 is: '||p_mm_trans_rate_temp(i));
3997: END IF;

Line 3994: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA fair value is: '||p_fair_value_temp(i));

3990: END IF; -- end threshold check for fv/sens calculations
3991:
3992: IF (g_proc_level>=g_debug_level) THEN
3993: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA deal no is: '||p_deal_nos(i));
3994: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA fair value is: '||p_fair_value_temp(i));
3995: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA reval rate ACT365 is: '||p_mm_reval_rate_temp(i));
3996: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA trans rate ACT365 is: '||p_mm_trans_rate_temp(i));
3997: END IF;
3998:

Line 3995: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA reval rate ACT365 is: '||p_mm_reval_rate_temp(i));

3991:
3992: IF (g_proc_level>=g_debug_level) THEN
3993: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA deal no is: '||p_deal_nos(i));
3994: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA fair value is: '||p_fair_value_temp(i));
3995: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA reval rate ACT365 is: '||p_mm_reval_rate_temp(i));
3996: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA trans rate ACT365 is: '||p_mm_trans_rate_temp(i));
3997: END IF;
3998:
3999: ELSIF (p_deal_types(i)='IRO') THEN

Line 3996: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA trans rate ACT365 is: '||p_mm_trans_rate_temp(i));

3992: IF (g_proc_level>=g_debug_level) THEN
3993: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA deal no is: '||p_deal_nos(i));
3994: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA fair value is: '||p_fair_value_temp(i));
3995: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA reval rate ACT365 is: '||p_mm_reval_rate_temp(i));
3996: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'FRA trans rate ACT365 is: '||p_mm_trans_rate_temp(i));
3997: END IF;
3998:
3999: ELSIF (p_deal_types(i)='IRO') THEN
4000: p_maturity_amount_temp(i) := p_face_values(i);

Line 4048: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO trans rate in: '||p_transaction_rates(i));

4044: p_rc_in.p_compound_freq_out := 1;
4045: END IF;
4046: p_rc_in.p_rate_in := p_transaction_rates(i);
4047: IF (g_proc_level>=g_debug_level) THEN
4048: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO trans rate in: '||p_transaction_rates(i));
4049: END IF;
4050: rate_conversion(p_rc_in, p_rc_out);
4051: p_mm_trans_rate_temp(i) := p_rc_out.p_rate_out;
4052: ELSE

Line 4078: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO deal ccy is: '||p_deal_ccys(i));

4074:
4075: IF (p_insert_or_update <> 'N') THEN
4076: -- fair value, reval rate (= fwd fwd rate in Act/365)
4077: IF (g_proc_level>=g_debug_level) THEN
4078: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO deal ccy is: '||p_deal_ccys(i));
4079: END IF;
4080: QRM_MM_FORMULAS.fv_iro(p_pricing_models(i),
4081: p_market_data_set_temp(i), p_deal_subtypes(i),
4082: p_deal_ccys(i), p_interpolation_method, p_ref_date,

Line 4159: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO volatility is: '||p_volatility_temp(i));

4155: p_md_in.p_indicator := 'V';
4156: XTR_MARKET_DATA_P.get_md_from_set(p_md_in, p_md_out);
4157: p_volatility_temp(i) := p_md_out.p_md_out;
4158: IF (g_proc_level>=g_debug_level) THEN
4159: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO volatility is: '||p_volatility_temp(i));
4160: END IF;
4161:
4162: p_bo_in.p_volatility := p_md_out.p_md_out;
4163: QRM_MM_FORMULAS.black_option_sens(p_bo_in, p_bo_out);

Line 4305: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO deal no: '||p_deal_nos(i));

4301: p_pos_vega_sob_temp(i) := p_deal_calculations.pos_vega_sob;
4302: END IF; -- check threshold check for fv/sens calculations
4303:
4304: IF (g_proc_level>=g_debug_level) THEN
4305: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO deal no: '||p_deal_nos(i));
4306: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO mm reval rate: '||p_mm_reval_rate_temp(i));
4307: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO fair value is: '||p_fair_value_temp(i));
4308: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO delta is: '||p_delta_temp(i));
4309: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO theta is: '||p_theta_temp(i));

Line 4306: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO mm reval rate: '||p_mm_reval_rate_temp(i));

4302: END IF; -- check threshold check for fv/sens calculations
4303:
4304: IF (g_proc_level>=g_debug_level) THEN
4305: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO deal no: '||p_deal_nos(i));
4306: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO mm reval rate: '||p_mm_reval_rate_temp(i));
4307: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO fair value is: '||p_fair_value_temp(i));
4308: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO delta is: '||p_delta_temp(i));
4309: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO theta is: '||p_theta_temp(i));
4310: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO rho is: '||p_rho_for_temp(i));

Line 4307: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO fair value is: '||p_fair_value_temp(i));

4303:
4304: IF (g_proc_level>=g_debug_level) THEN
4305: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO deal no: '||p_deal_nos(i));
4306: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO mm reval rate: '||p_mm_reval_rate_temp(i));
4307: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO fair value is: '||p_fair_value_temp(i));
4308: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO delta is: '||p_delta_temp(i));
4309: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO theta is: '||p_theta_temp(i));
4310: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO rho is: '||p_rho_for_temp(i));
4311: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO gamma is: '||p_gamma_temp(i));

Line 4308: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO delta is: '||p_delta_temp(i));

4304: IF (g_proc_level>=g_debug_level) THEN
4305: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO deal no: '||p_deal_nos(i));
4306: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO mm reval rate: '||p_mm_reval_rate_temp(i));
4307: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO fair value is: '||p_fair_value_temp(i));
4308: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO delta is: '||p_delta_temp(i));
4309: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO theta is: '||p_theta_temp(i));
4310: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO rho is: '||p_rho_for_temp(i));
4311: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO gamma is: '||p_gamma_temp(i));
4312: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO vega is: '||p_vega_temp(i));

Line 4309: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO theta is: '||p_theta_temp(i));

4305: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO deal no: '||p_deal_nos(i));
4306: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO mm reval rate: '||p_mm_reval_rate_temp(i));
4307: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO fair value is: '||p_fair_value_temp(i));
4308: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO delta is: '||p_delta_temp(i));
4309: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO theta is: '||p_theta_temp(i));
4310: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO rho is: '||p_rho_for_temp(i));
4311: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO gamma is: '||p_gamma_temp(i));
4312: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO vega is: '||p_vega_temp(i));
4313: END IF;

Line 4310: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO rho is: '||p_rho_for_temp(i));

4306: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO mm reval rate: '||p_mm_reval_rate_temp(i));
4307: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO fair value is: '||p_fair_value_temp(i));
4308: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO delta is: '||p_delta_temp(i));
4309: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO theta is: '||p_theta_temp(i));
4310: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO rho is: '||p_rho_for_temp(i));
4311: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO gamma is: '||p_gamma_temp(i));
4312: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO vega is: '||p_vega_temp(i));
4313: END IF;
4314:

Line 4311: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO gamma is: '||p_gamma_temp(i));

4307: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO fair value is: '||p_fair_value_temp(i));
4308: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO delta is: '||p_delta_temp(i));
4309: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO theta is: '||p_theta_temp(i));
4310: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO rho is: '||p_rho_for_temp(i));
4311: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO gamma is: '||p_gamma_temp(i));
4312: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO vega is: '||p_vega_temp(i));
4313: END IF;
4314:
4315: ELSIF (p_deal_types(i)='BDO') THEN

Line 4312: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO vega is: '||p_vega_temp(i));

4308: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO delta is: '||p_delta_temp(i));
4309: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO theta is: '||p_theta_temp(i));
4310: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO rho is: '||p_rho_for_temp(i));
4311: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO gamma is: '||p_gamma_temp(i));
4312: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IRO vega is: '||p_vega_temp(i));
4313: END IF;
4314:
4315: ELSIF (p_deal_types(i)='BDO') THEN
4316: p_maturity_amount_temp(i) := p_face_values(i);

Line 4379: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'ric code does not exist');

4375: IF (get_bond_code%NOTFOUND) THEN
4376: -- settings bond code to null will cause
4377: -- cause api's to throw no data found exception
4378: IF (g_proc_level>=g_debug_level) THEN
4379: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'ric code does not exist');
4380: END IF;
4381: p_bond_code := null;
4382: END IF;
4383: CLOSE get_bond_code;

Line 4559: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'onc accrued int: '||p_accrued_interest_temp(i));

4555: p_interests(i), p_accum_int_bfs(i),
4556: p_face_values(i), p_no_of_days(i),
4557: p_day_count_bases(i), p_accum_int_actions(i));
4558: IF (g_proc_level>=g_debug_level) THEN
4559: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'onc accrued int: '||p_accrued_interest_temp(i));
4560: END IF;
4561: if (nvl(p_prepaid_interests(i),'N')='Y' and p_ref_date >= p_start_dates(i)) then
4562: p_accrued_interest_temp(i) := p_accrued_interest_temp(i) - nvl(p_interests(i),0);
4563: end if;

Line 4676: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IG DCB: '||p_day_count_bases(i));

4672:
4673: IF (p_insert_or_update <> 'N') THEN
4674: -- accrued interest
4675: IF (g_proc_level>=g_debug_level) THEN
4676: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IG DCB: '||p_day_count_bases(i));
4677: END IF;
4678: days_run_helper(p_start_dates(i), p_ref_date,
4679: p_day_count_bases(i), NULL, p_day_count, p_annual_basis);
4680:

Line 4686: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'prev accrued int: '||p_accrued_interests(i));

4682: -- and accrual of this transaction
4683: -- no need to modify sign of accrued int/ fair value
4684: -- because balance saved in db already carries sign
4685: IF (g_proc_level>=g_debug_level) THEN
4686: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'prev accrued int: '||p_accrued_interests(i));
4687: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'balance: '||p_face_values(i));
4688: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'int rate: '||p_transaction_rates(i));
4689: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'days accrued: '||p_day_count);
4690: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'annual basis: '||p_annual_basis);

Line 4687: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'balance: '||p_face_values(i));

4683: -- no need to modify sign of accrued int/ fair value
4684: -- because balance saved in db already carries sign
4685: IF (g_proc_level>=g_debug_level) THEN
4686: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'prev accrued int: '||p_accrued_interests(i));
4687: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'balance: '||p_face_values(i));
4688: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'int rate: '||p_transaction_rates(i));
4689: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'days accrued: '||p_day_count);
4690: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'annual basis: '||p_annual_basis);
4691: END IF;

Line 4688: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'int rate: '||p_transaction_rates(i));

4684: -- because balance saved in db already carries sign
4685: IF (g_proc_level>=g_debug_level) THEN
4686: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'prev accrued int: '||p_accrued_interests(i));
4687: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'balance: '||p_face_values(i));
4688: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'int rate: '||p_transaction_rates(i));
4689: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'days accrued: '||p_day_count);
4690: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'annual basis: '||p_annual_basis);
4691: END IF;
4692: p_accrued_interest_temp(i) := p_accrued_interests(i) +

Line 4689: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'days accrued: '||p_day_count);

4685: IF (g_proc_level>=g_debug_level) THEN
4686: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'prev accrued int: '||p_accrued_interests(i));
4687: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'balance: '||p_face_values(i));
4688: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'int rate: '||p_transaction_rates(i));
4689: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'days accrued: '||p_day_count);
4690: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'annual basis: '||p_annual_basis);
4691: END IF;
4692: p_accrued_interest_temp(i) := p_accrued_interests(i) +
4693: p_face_values(i)*p_transaction_rates(i)*p_day_count/

Line 4690: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'annual basis: '||p_annual_basis);

4686: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'prev accrued int: '||p_accrued_interests(i));
4687: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'balance: '||p_face_values(i));
4688: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'int rate: '||p_transaction_rates(i));
4689: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'days accrued: '||p_day_count);
4690: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'annual basis: '||p_annual_basis);
4691: END IF;
4692: p_accrued_interest_temp(i) := p_accrued_interests(i) +
4693: p_face_values(i)*p_transaction_rates(i)*p_day_count/
4694: (100*p_annual_basis);

Line 4736: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'PAST DEAL SWITCH LOOP');

4732: END IF; -- end threshold check for fv/sens calculations
4733:
4734: END IF; -- end if fxo or fx
4735: IF (g_proc_level>=g_debug_level) THEN
4736: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'PAST DEAL SWITCH LOOP');
4737: END IF;
4738:
4739:
4740:

Line 5126: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'deal type is: '||p_deal_types(i));

5122: ----- >>> ALWAYS RECALCULATE <<< -------
5123: -- for QRM_TB_CALCULATIONS: calculate everytime for MM deals
5124: -- for FX/FXO deals, simply save to table
5125: IF (g_proc_level>=g_debug_level) THEN
5126: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'deal type is: '||p_deal_types(i));
5127: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'deal no is : '||p_deal_nos(i));
5128: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'trans no is: '||p_transaction_nos(i));
5129: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'mds is: '||p_market_data_set_temp(i));
5130: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'tb counter is: '||p_tb_counter);

Line 5127: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'deal no is : '||p_deal_nos(i));

5123: -- for QRM_TB_CALCULATIONS: calculate everytime for MM deals
5124: -- for FX/FXO deals, simply save to table
5125: IF (g_proc_level>=g_debug_level) THEN
5126: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'deal type is: '||p_deal_types(i));
5127: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'deal no is : '||p_deal_nos(i));
5128: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'trans no is: '||p_transaction_nos(i));
5129: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'mds is: '||p_market_data_set_temp(i));
5130: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'tb counter is: '||p_tb_counter);
5131: END IF;

Line 5128: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'trans no is: '||p_transaction_nos(i));

5124: -- for FX/FXO deals, simply save to table
5125: IF (g_proc_level>=g_debug_level) THEN
5126: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'deal type is: '||p_deal_types(i));
5127: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'deal no is : '||p_deal_nos(i));
5128: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'trans no is: '||p_transaction_nos(i));
5129: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'mds is: '||p_market_data_set_temp(i));
5130: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'tb counter is: '||p_tb_counter);
5131: END IF;
5132:

Line 5129: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'mds is: '||p_market_data_set_temp(i));

5125: IF (g_proc_level>=g_debug_level) THEN
5126: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'deal type is: '||p_deal_types(i));
5127: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'deal no is : '||p_deal_nos(i));
5128: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'trans no is: '||p_transaction_nos(i));
5129: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'mds is: '||p_market_data_set_temp(i));
5130: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'tb counter is: '||p_tb_counter);
5131: END IF;
5132:
5133: IF (p_deal_types(i) NOT IN ('FX', 'FXO')) THEN

Line 5130: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'tb counter is: '||p_tb_counter);

5126: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'deal type is: '||p_deal_types(i));
5127: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'deal no is : '||p_deal_nos(i));
5128: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'trans no is: '||p_transaction_nos(i));
5129: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'mds is: '||p_market_data_set_temp(i));
5130: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'tb counter is: '||p_tb_counter);
5131: END IF;
5132:
5133: IF (p_deal_types(i) NOT IN ('FX', 'FXO')) THEN
5134: IF (g_proc_level>=g_debug_level) THEN

Line 5135: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'TB not fx/fxo! deal no: '||p_deal_nos(i));

5131: END IF;
5132:
5133: IF (p_deal_types(i) NOT IN ('FX', 'FXO')) THEN
5134: IF (g_proc_level>=g_debug_level) THEN
5135: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'TB not fx/fxo! deal no: '||p_deal_nos(i));
5136: END IF;
5137: IF (p_deal_types(i)='BOND') THEN
5138: p_tb_deal_no.EXTEND;
5139: p_tb_transaction_no.EXTEND;

Line 5256: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'Past stock tb calculations');

5252: p_tb_amt_qty_out(p_tb_counter) := p_quantity_out(i);
5253: p_tb_amt_qty_out_sob(p_tb_counter) := p_quantity_out(i);
5254: p_tb_amt_qty_out_usd(p_tb_counter) := p_quantity_out(i);
5255: IF (g_proc_level>=g_debug_level) THEN
5256: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'Past stock tb calculations');
5257: END IF;
5258: ELSIF (p_deal_types(i)='NI') THEN
5259: p_tb_deal_no.EXTEND;
5260: p_tb_transaction_no.EXTEND;

Line 5292: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI deal no', p_deal_nos(i));

5288: p_tb_end_date(p_tb_counter) := p_maturity_dates(i);
5289: p_tb_outst_amount(p_tb_counter) := get_signed_amount(p_face_values(i), p_deal_types(i), p_deal_subtypes(i), null);
5290: p_tb_interest_basis(p_tb_counter) := 'F';
5291: IF (g_proc_level>=g_debug_level) THEN
5292: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI deal no', p_deal_nos(i));
5293: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI trans rate', p_transaction_rates(i));
5294: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI coupon rate', p_coupon_rates(i));
5295: END IF;
5296: p_tb_coupon_rate(p_tb_counter) := p_coupon_rates(i);

Line 5293: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI trans rate', p_transaction_rates(i));

5289: p_tb_outst_amount(p_tb_counter) := get_signed_amount(p_face_values(i), p_deal_types(i), p_deal_subtypes(i), null);
5290: p_tb_interest_basis(p_tb_counter) := 'F';
5291: IF (g_proc_level>=g_debug_level) THEN
5292: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI deal no', p_deal_nos(i));
5293: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI trans rate', p_transaction_rates(i));
5294: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI coupon rate', p_coupon_rates(i));
5295: END IF;
5296: p_tb_coupon_rate(p_tb_counter) := p_coupon_rates(i);
5297: p_tb_next_coupon_date(p_tb_counter) := TO_DATE(NULL);

Line 5294: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI coupon rate', p_coupon_rates(i));

5290: p_tb_interest_basis(p_tb_counter) := 'F';
5291: IF (g_proc_level>=g_debug_level) THEN
5292: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI deal no', p_deal_nos(i));
5293: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI trans rate', p_transaction_rates(i));
5294: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NI coupon rate', p_coupon_rates(i));
5295: END IF;
5296: p_tb_coupon_rate(p_tb_counter) := p_coupon_rates(i);
5297: p_tb_next_coupon_date(p_tb_counter) := TO_DATE(NULL);
5298: -- convert outstanding amounts

Line 5318: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'Past stock tb calculations');

5314: p_tb_amt_qty_out(p_tb_counter) := NULL;
5315: p_tb_amt_qty_out_sob(p_tb_counter) := NULL;
5316: p_tb_amt_qty_out_usd(p_tb_counter) := NULL;
5317: IF (g_proc_level>=g_debug_level) THEN
5318: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'Past stock tb calculations');
5319: END IF;
5320:
5321: ELSIF (p_deal_types(i) IN ('TMM', 'IRS', 'RTMM')) THEN
5322: p_maturity_amount_temp(i) := 0;

Line 5735: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IG 1');

5731: p_tb_amt_qty_out_sob(p_tb_counter) := NULL;
5732: p_tb_amt_qty_out_usd(p_tb_counter) := NULL;
5733:
5734: IF (g_proc_level>=g_debug_level) THEN
5735: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IG 1');
5736: END IF;
5737: p_tb_deal_no(p_tb_counter) := p_deal_nos(i);
5738: p_tb_transaction_no(p_tb_counter) := p_transaction_nos(i);
5739: p_tb_market_data_set(p_tb_counter) := p_market_data_set_temp(i);

Line 5754: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IG 2');

5750: p_tb_interest_basis(p_tb_counter) := 'F';
5751: p_tb_coupon_rate(p_tb_counter) := p_coupon_rates(i);
5752: p_tb_next_coupon_date(p_tb_counter) := TO_DATE(NULL);
5753: IF (g_proc_level>=g_debug_level) THEN
5754: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IG 2');
5755: END IF;
5756: -- convert outstanding amounts
5757: IF (p_deal_ccys(i) = 'USD') THEN
5758: p_tb_outst_amount_usd(p_tb_counter) := p_tb_outst_amount(p_tb_counter);

Line 5765: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IG 3');

5761: p_deal_ccys(i),'USD', p_tb_outst_amount(p_tb_counter),
5762: p_tb_outst_amount_usd(p_tb_counter));
5763: END IF;
5764: IF (g_proc_level>=g_debug_level) THEN
5765: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'IG 3');
5766: END IF;
5767: IF (p_deal_ccys(i) = p_sob_ccy_temp(i)) THEN
5768: p_tb_outst_amount_sob(p_tb_counter) := p_tb_outst_amount(p_tb_counter);
5769: ELSE

Line 5851: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'end of tb calculations');

5847: end if;
5848: end if;
5849:
5850: IF (g_proc_level>=g_debug_level) THEN
5851: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'end of tb calculations');
5852: END IF;
5853: END IF; -- end deal ok : passed gap date test
5854:
5855:

Line 5874: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','QRM_ANA_NO_CURVE_FOUND',

5870: p_except_error_type(p_except_counter) := 'W';
5871: p_except_error_code(p_except_counter):='QRM_ANA_NO_CURVE_FOUND';
5872: --bug 3236479
5873: IF (g_proc_level>=g_ERROR_level) THEN
5874: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','QRM_ANA_NO_CURVE_FOUND',
5875: 'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS',
5876: g_error_level);
5877: END IF;
5878: WHEN XTR_MARKET_DATA_P.e_mdcs_no_data_found THEN

Line 5895: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','QRM_ANA_NO_DATA_FOUND',

5891: p_except_error_type(p_except_counter):='W';
5892: p_except_error_code(p_except_counter):='QRM_ANA_NO_DATA_FOUND';
5893: --bug 3236479
5894: IF (g_proc_level>=g_ERROR_level) THEN
5895: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','QRM_ANA_NO_DATA_FOUND',
5896: 'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS',
5897: g_error_level);
5898: END IF;
5899: WHEN QRM_MM_FORMULAS.e_option_vol_zero THEN

Line 5916: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','QRM_ANA_OPTION_VOL_ZERO',

5912: p_except_error_type(p_except_counter):='W';
5913: p_except_error_code(p_except_counter):='QRM_ANA_OPTION_VOL_ZERO';
5914: --bug 3236479
5915: IF (g_proc_level>=g_ERROR_level) THEN
5916: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','QRM_ANA_OPTION_VOL_ZERO',
5917: 'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS',
5918: g_error_level);
5919: END IF;
5920: WHEN no_data_found THEN -- market data set api returned no rows

Line 5937: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','QRM_ANA_NO_DATA_FOUND',

5933: p_except_error_type(p_except_counter):='W';
5934: p_except_error_code(p_except_counter):='QRM_ANA_NO_DATA_FOUND';
5935: --bug 3236479
5936: IF (g_proc_level>=g_ERROR_level) THEN
5937: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','QRM_ANA_NO_DATA_FOUND',
5938: 'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS',
5939: g_error_level);
5940: END IF;
5941: --bug 2560111

Line 5959: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','QRM_ANA_DATE_RANGE_ERR',

5955: p_except_error_type(p_except_counter):='W';
5956: p_except_error_code(p_except_counter):='QRM_ANA_DATE_RANGE_ERR';
5957: --bug 3236479
5958: IF (g_proc_level>=g_ERROR_level) THEN
5959: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','QRM_ANA_DATE_RANGE_ERR',
5960: 'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS',
5961: g_error_level);
5962: END IF;
5963: --bug 2558279

Line 5981: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','QRM_DIV_BY_ZERO_ERR',

5977: p_except_error_type(p_except_counter):='W';
5978: p_except_error_code(p_except_counter):='QRM_DIV_BY_ZERO_ERR';
5979: --bug 3236479
5980: IF (g_proc_level>=g_ERROR_level) THEN
5981: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','QRM_DIV_BY_ZERO_ERR',
5982: 'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS',
5983: g_error_level);
5984: END IF;
5985: --bug 2875633

Line 5987: IF xtr_risk_debug_pkg.g_Debug THEN

5983: g_error_level);
5984: END IF;
5985: --bug 2875633
5986: WHEN e_duplicate_tb_rows THEN -- invalid deal information
5987: IF xtr_risk_debug_pkg.g_Debug THEN
5988: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'duplicate tb rows');
5989: END IF;
5990: retcode := '1'; -- success with warnings
5991: p_except_counter := p_except_counter + 1;

Line 5988: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'duplicate tb rows');

5984: END IF;
5985: --bug 2875633
5986: WHEN e_duplicate_tb_rows THEN -- invalid deal information
5987: IF xtr_risk_debug_pkg.g_Debug THEN
5988: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'duplicate tb rows');
5989: END IF;
5990: retcode := '1'; -- success with warnings
5991: p_except_counter := p_except_counter + 1;
5992: p_except_deal_no.EXTEND;

Line 6022: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','QRM_ANA_UNEXPECTED_ERROR inner loop',

6018: p_except_error_type(p_except_counter):='W';
6019: p_except_error_code(p_except_counter):='QRM_ANA_UNEXPECTED_ERROR';
6020: --bug 3236479
6021: IF (g_proc_level>=g_ERROR_level) THEN
6022: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','QRM_ANA_UNEXPECTED_ERROR inner loop',
6023: 'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS',
6024: g_error_level);
6025: END IF;
6026: /* commented out for bug 2602235

Line 6029: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'unhandled exp at deal level');

6025: END IF;
6026: /* commented out for bug 2602235
6027: WHEN OTHERS THEN
6028: IF (g_proc_level>=g_debug_level) THEN
6029: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'unhandled exp at deal level');
6030: END IF;
6031: -- unhandled exception, clear previous warnings
6032: p_except_counter := 0;
6033: p_except_deal_no.DELETE;

Line 6059: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'about to restart loop');

6055: exit; -- exit loop
6056: */
6057: END;
6058: IF (g_proc_level>=g_debug_level) THEN
6059: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'about to restart loop');
6060: END IF;
6061: END LOOP;
6062:
6063:

Line 6069: --XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'about to insert');

6065: IF (retcode <> '2') THEN
6066: -- perform database DML
6067: --- INSERT into QRM_DEAL_CALCULATIONS
6068: IF (g_state_level>=g_debug_level) THEN --bug 3236479
6069: --XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'about to insert');
6070: for j in 1..p_insert_counter loop
6071: v_log := p_seq_nos(j)||';'||
6072: p_deal_no_insert(j)||';'|| p_transaction_no_insert(j)||';'||
6073: p_market_data_set_insert(j)||';'|| p_deal_ccy_insert(j)||';'||

Line 6081: XTR_RISK_DEBUG_PKG.dlog('INSERT QRM_DEAL_CALCULATIONS Line 1',v_log,

6077: p_foreign_amount_sob_insert(j)||';'|| p_domestic_amount_usd_insert(j)||';'||
6078: p_domestic_amount_sob_insert(j)||';'|| p_buy_amount_usd_insert(j)||';'||
6079: p_buy_amount_sob_insert(j)||';'|| p_sell_amount_usd_insert(j)||';'||
6080: p_sell_amount_sob_insert(j)||';'|| p_days_insert(j);
6081: XTR_RISK_DEBUG_PKG.dlog('INSERT QRM_DEAL_CALCULATIONS Line 1',v_log,
6082: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_state_level);
6083: v_log := p_fx_reval_rate_insert(j)||';'||p_mm_reval_rate_insert(j)||';'||
6084: p_fx_trans_rate_insert(j)||';'|| p_mm_trans_rate_insert(j)||';'||
6085: p_fair_value_insert(j)||';'|| p_fair_value_usd_insert(j)||';'||

Line 6092: XTR_RISK_DEBUG_PKG.dlog('INSERT QRM_DEAL_CALCULATIONS Line 2',v_log,

6088: p_maturity_amount_insert(j)||';'|| p_maturity_amount_usd_insert(j)||';'||
6089: p_maturity_amount_sob_insert(j)||';'|| p_premium_amount_usd_insert(j)||';'||
6090: p_premium_amount_sob_insert(j)||';'|| p_accrued_interest_insert(j)||';'||
6091: p_accrued_interest_usd_insert(j)||';'|| p_accrued_interest_sob_insert(j);
6092: XTR_RISK_DEBUG_PKG.dlog('INSERT QRM_DEAL_CALCULATIONS Line 2',v_log,
6093: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_state_level);
6094: v_log := p_duration_insert(j)||';'|| p_mod_duration_insert(j)||';'||
6095: p_convexity_insert(j)||';'|| p_delta_insert(j)||';'|| p_gamma_insert(j)||';'||
6096: p_theta_insert(j)||';'|| p_rho_insert(j)||';'|| p_rho_base_insert(j)||';'||

Line 6108: XTR_RISK_DEBUG_PKG.dlog('INSERT QRM_DEAL_CALCULATIONS Line 3',v_log,

6104: p_pos_rho_insert(j)||';'|| p_pos_rho_usd_insert(j)||';'||
6105: p_pos_rho_sob_insert(j)||';'|| p_pos_rho_base_insert(j)||';'||
6106: p_pos_rho_base_usd_insert(j)||';'|| p_pos_rho_base_sob_insert(j)||';'||
6107: p_pos_rho_contra_insert(j)||';'|| p_pos_rho_contra_usd_insert(j);
6108: XTR_RISK_DEBUG_PKG.dlog('INSERT QRM_DEAL_CALCULATIONS Line 3',v_log,
6109: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_state_level);
6110: v_log := p_pos_rho_contra_sob_insert(j)||';'|| p_pos_rho_for_insert(j)||';'||
6111: p_pos_rho_for_usd_insert(j)||';'|| p_pos_rho_for_sob_insert(j)||';'||
6112: p_pos_rho_dom_insert(j)||';'|| p_pos_rho_dom_usd_insert(j)||';'||

Line 6120: XTR_RISK_DEBUG_PKG.dlog('INSERT QRM_DEAL_CALCULATIONS Line 4',v_log,

6116: p_gap_date_insert(j)||';'|| p_reval_price_insert(j)||';'||
6117: p_reval_price_usd_insert(j)||';'|| p_reval_price_sob_insert(j)||';'||
6118: p_trans_price_insert(j)||';'|| p_trans_price_usd_insert(j)||';'||
6119: p_trans_price_sob_insert(j)||';'|| p_ref_datetime;
6120: XTR_RISK_DEBUG_PKG.dlog('INSERT QRM_DEAL_CALCULATIONS Line 4',v_log,
6121: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_state_level);
6122: end loop;
6123: END IF;
6124:

Line 6204: XTR_RISK_DEBUG_PKG.dlog('DML','INSERTED QRM_DEAL_CALCULATIONS',

6200: FND_GLOBAL.conc_request_id, FND_GLOBAL.prog_appl_id,
6201: FND_GLOBAL.conc_program_id, p_ref_datetime);
6202:
6203: IF (g_event_level>=g_debug_level) THEN --bug 3236479
6204: XTR_RISK_DEBUG_PKG.dlog('DML','INSERTED QRM_DEAL_CALCULATIONS',
6205: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_event_level);
6206: END IF;
6207:
6208: --- UPDATE QRM_DEAL_CALCULATIONS

Line 6210: --XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'about to update');

6206: END IF;
6207:
6208: --- UPDATE QRM_DEAL_CALCULATIONS
6209: IF (g_state_level>=g_debug_level) THEN --bug 3236479
6210: --XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'about to update');
6211: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'p_update_counter: '|| p_update_counter);
6212: for j in 1..p_update_counter loop
6213: v_log := p_deal_ccy_update(j)||';'||
6214: p_sob_ccy_update(j)||';'|| p_base_ccy_amount_usd_update(j)||';'||

Line 6211: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'p_update_counter: '|| p_update_counter);

6207:
6208: --- UPDATE QRM_DEAL_CALCULATIONS
6209: IF (g_state_level>=g_debug_level) THEN --bug 3236479
6210: --XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'about to update');
6211: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'p_update_counter: '|| p_update_counter);
6212: for j in 1..p_update_counter loop
6213: v_log := p_deal_ccy_update(j)||';'||
6214: p_sob_ccy_update(j)||';'|| p_base_ccy_amount_usd_update(j)||';'||
6215: p_base_ccy_amount_sob_update(j)||';'|| p_contra_ccy_amount_usd_update(j)||';'||

Line 6221: XTR_RISK_DEBUG_PKG.dlog('update QRM_DEAL_CALCULATIONS Line 1',v_log,

6217: p_foreign_amount_sob_update(j)||';'|| p_domestic_amount_usd_update(j)||';'||
6218: p_domestic_amount_sob_update(j)||';'|| p_buy_amount_usd_update(j)||';'||
6219: p_buy_amount_sob_update(j)||';'|| p_sell_amount_usd_update(j)||';'||
6220: p_sell_amount_sob_update(j)||';'|| p_days_update(j);
6221: XTR_RISK_DEBUG_PKG.dlog('update QRM_DEAL_CALCULATIONS Line 1',v_log,
6222: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_state_level);
6223: v_log := p_fx_reval_rate_update(j)||';'||p_mm_reval_rate_update(j)||';'||
6224: p_fx_trans_rate_update(j)||';'|| p_mm_trans_rate_update(j)||';'||
6225: p_fair_value_update(j)||';'|| p_fair_value_usd_update(j)||';'||

Line 6232: XTR_RISK_DEBUG_PKG.dlog('update QRM_DEAL_CALCULATIONS Line 2',v_log,

6228: p_maturity_amount_update(j)||';'|| p_maturity_amount_usd_update(j)||';'||
6229: p_maturity_amount_sob_update(j)||';'|| p_premium_amount_usd_update(j)||';'||
6230: p_premium_amount_sob_update(j)||';'|| p_accrued_interest_update(j)||';'||
6231: p_accrued_interest_usd_update(j)||';'|| p_accrued_interest_sob_update(j);
6232: XTR_RISK_DEBUG_PKG.dlog('update QRM_DEAL_CALCULATIONS Line 2',v_log,
6233: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_state_level);
6234: v_log := p_duration_update(j)||';'|| p_mod_duration_update(j)||';'||
6235: p_convexity_update(j)||';'|| p_delta_update(j)||';'|| p_gamma_update(j)||';'||
6236: p_theta_update(j)||';'|| p_rho_update(j)||';'|| p_rho_base_update(j)||';'||

Line 6248: XTR_RISK_DEBUG_PKG.dlog('update QRM_DEAL_CALCULATIONS Line 3',v_log,

6244: p_pos_rho_update(j)||';'|| p_pos_rho_usd_update(j)||';'||
6245: p_pos_rho_sob_update(j)||';'|| p_pos_rho_base_update(j)||';'||
6246: p_pos_rho_base_usd_update(j)||';'|| p_pos_rho_base_sob_update(j)||';'||
6247: p_pos_rho_contra_update(j)||';'|| p_pos_rho_contra_usd_update(j);
6248: XTR_RISK_DEBUG_PKG.dlog('update QRM_DEAL_CALCULATIONS Line 3',v_log,
6249: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_state_level);
6250: v_log := p_pos_rho_contra_sob_update(j)||';'|| p_pos_rho_for_update(j)||';'||
6251: p_pos_rho_for_usd_update(j)||';'|| p_pos_rho_for_sob_update(j)||';'||
6252: p_pos_rho_dom_update(j)||';'|| p_pos_rho_dom_usd_update(j)||';'||

Line 6260: XTR_RISK_DEBUG_PKG.dlog('update QRM_DEAL_CALCULATIONS Line 4',v_log,

6256: p_gap_date_update(j)||';'|| p_reval_price_update(j)||';'||
6257: p_reval_price_usd_update(j)||';'|| p_reval_price_sob_update(j)||';'||
6258: p_trans_price_update(j)||';'|| p_trans_price_usd_update(j)||';'||
6259: p_trans_price_sob_update(j)||';'|| p_ref_datetime;
6260: XTR_RISK_DEBUG_PKG.dlog('update QRM_DEAL_CALCULATIONS Line 4',v_log,
6261: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_state_level);
6262: end loop;
6263: END IF;
6264:

Line 6356: XTR_RISK_DEBUG_PKG.dlog('DML','UPDATED QRM_DEAL_CALCULATIONS',

6352: program_update_date=p_ref_datetime
6353: WHERE deal_calc_id = p_deal_calc_id_update(j);
6354:
6355: IF (g_event_level>=g_debug_level) THEN --bug 3236479
6356: XTR_RISK_DEBUG_PKG.dlog('DML','UPDATED QRM_DEAL_CALCULATIONS',
6357: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_event_level);
6358: END IF;
6359:
6360: -- UPDATE QRM_DEALS_ANALYSES

Line 6363: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'about to delete');

6359:
6360: -- UPDATE QRM_DEALS_ANALYSES
6361: -- first delete all old links
6362: IF (g_proc_level>=g_debug_level) THEN
6363: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'about to delete');
6364: END IF;
6365: /* BUG 2945198 - SQL BINDING
6366: DELETE
6367: FROM qrm_deals_analyses

Line 6378: XTR_RISK_DEBUG_PKG.dlog('INSERT QRM_DEALS_ANALYSES',v_log,

6374: v_log := p_seq_nos(j)||','|| p_analysis_name||','|| p_company_code_insert(j)||','||
6375: FND_GLOBAL.user_id||','|| p_ref_datetime||','|| FND_GLOBAL.user_id||','||
6376: p_ref_datetime||','|| FND_GLOBAL.login_id||','|| FND_GLOBAL.conc_request_id||','||
6377: FND_GLOBAL.prog_appl_id||','|| FND_GLOBAL.conc_program_id||','||p_ref_datetime;
6378: XTR_RISK_DEBUG_PKG.dlog('INSERT QRM_DEALS_ANALYSES',v_log,
6379: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_state_level);
6380: end loop;
6381: for j in 1..p_update_counter loop
6382: v_log := p_deal_calc_id_update(j)||','||p_analysis_name||','||p_company_code_update(j);

Line 6383: XTR_RISK_DEBUG_PKG.dlog('INSERT QRM_DEALS_ANALYSES',v_log,

6379: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_state_level);
6380: end loop;
6381: for j in 1..p_update_counter loop
6382: v_log := p_deal_calc_id_update(j)||','||p_analysis_name||','||p_company_code_update(j);
6383: XTR_RISK_DEBUG_PKG.dlog('INSERT QRM_DEALS_ANALYSES',v_log,
6384: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_state_level);
6385: end loop;
6386: end if;
6387:

Line 6410: XTR_RISK_DEBUG_PKG.dlog('DML','INSERTED QRM_DEAL_ANALYSES',

6406: FND_GLOBAL.conc_request_id, FND_GLOBAL.prog_appl_id,
6407: FND_GLOBAL.conc_program_id, p_ref_datetime);
6408:
6409: IF (g_event_level>=g_debug_level) THEN --bug 3236479
6410: XTR_RISK_DEBUG_PKG.dlog('DML','INSERTED QRM_DEAL_ANALYSES',
6411: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_event_level);
6412: END IF;
6413:
6414: -- UPDATE QRM_TB_CALCULATIONS

Line 6425: XTR_RISK_DEBUG_PKG.dlog('DML','DELETED QRM_TB_CALCULATIONS',

6421: AND market_data_set=p_tb_market_data_set(j);
6422: -- then insert new ones
6423:
6424: IF (g_event_level>=g_debug_level) THEN --bug 3236479
6425: XTR_RISK_DEBUG_PKG.dlog('DML','DELETED QRM_TB_CALCULATIONS',
6426: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_event_level);
6427: END IF;
6428:
6429: IF (g_state_level>=g_debug_level) THEN --bug 3236479

Line 6430: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'p_tb_counter: ' || p_tb_counter);

6426: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_event_level);
6427: END IF;
6428:
6429: IF (g_state_level>=g_debug_level) THEN --bug 3236479
6430: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'p_tb_counter: ' || p_tb_counter);
6431: for j in 1..p_tb_counter loop
6432: v_log := p_tb_deal_no(j)||','||
6433: p_tb_transaction_no(j)||','|| p_tb_market_data_set(j)||','||
6434: p_tb_pos_start_date(j)||','|| p_tb_pos_end_date(j)||','||

Line 6440: XTR_RISK_DEBUG_PKG.dlog('INSERT QRM_TB_CALCULATIONS',v_log,

6436: p_tb_interest_basis(j)||','|| p_tb_outst_amount(j)||','||
6437: p_tb_outst_amount_usd(j)||','|| p_tb_outst_amount_sob(j)||','||
6438: p_tb_coupon_rate(j)||','|| p_tb_next_coupon_date(j)||','|| p_tb_amt_qty_out(j)||','||
6439: p_tb_amt_qty_out_usd(j)||','|| p_tb_amt_qty_out_sob(j);
6440: XTR_RISK_DEBUG_PKG.dlog('INSERT QRM_TB_CALCULATIONS',v_log,
6441: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_state_level);
6442: end loop;
6443: end if;
6444:

Line 6468: XTR_RISK_DEBUG_PKG.dlog('DML','INSERTED QRM_TB_CALCULATIONS',

6464: p_ref_datetime, FND_GLOBAL.login_id, FND_GLOBAL.conc_request_id,
6465: FND_GLOBAL.prog_appl_id,FND_GLOBAL.conc_program_id,p_ref_datetime);
6466:
6467: IF (g_event_level>=g_debug_level) THEN --bug 3236479
6468: XTR_RISK_DEBUG_PKG.dlog('DML','INSERTED QRM_TB_CALCULATIONS',
6469: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_event_level);
6470: END IF;
6471:
6472: -- BUG 2945198 - SQL BINDING

Line 6484: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'unhandled exp during deal retrieval after DML');

6480: if dbms_sql.is_open(v_cursor) then
6481: dbms_sql.close_cursor(v_cursor);
6482: end if;
6483: IF (g_proc_level>=g_debug_level) THEN
6484: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'unhandled exp during deal retrieval after DML');
6485: END IF;
6486: -- unhandled exception, clear previous warnings
6487: p_except_counter := 0;
6488: p_except_deal_no.DELETE;

Line 6516: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NUMBER OF DEALS: ' || p_total_deals_counter);

6512:
6513: IF (retcode <> '2') THEN
6514:
6515: IF (g_proc_level>=g_debug_level) THEN
6516: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'NUMBER OF DEALS: ' || p_total_deals_counter);
6517: END IF;
6518:
6519: -- END BUG 2945198 - SQL BINDING
6520:

Line 6522: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'before commit');

6518:
6519: -- END BUG 2945198 - SQL BINDING
6520:
6521: IF (g_proc_level>=g_debug_level) THEN
6522: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'before commit');
6523: END IF;
6524:
6525: COMMIT;
6526:

Line 6530: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'past commit');

6526:
6527: -- no deal has passed gap analysis requirements
6528: -- thus, no rows returned
6529: IF (g_proc_level>=g_debug_level) THEN
6530: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'past commit');
6531: END IF;
6532: IF (NOT (p_gap_deal_exists)) THEN
6533: retcode := '5';
6534: END IF;

Line 6552: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'about to aggregate');

6548:
6549: -- CALL AGGREGATOR if analysis style is not 'T'
6550: IF (p_settings.style <> 'T' and retcode <> '5') THEN
6551: IF (g_proc_level>=g_debug_level) THEN
6552: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'about to aggregate');
6553: END IF;
6554: p_agg_ok := QRM_PA_AGGREGATION_P.transform_and_save(p_analysis_name,
6555: p_ref_datetime, 'CONC');
6556:

Line 6559: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'unhandled exception in aggregator!');

6555: p_ref_datetime, 'CONC');
6556:
6557: IF (p_agg_ok = 'F') THEN -- unhandled exception in aggregator
6558: IF (g_proc_level>=g_debug_level) THEN
6559: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'unhandled exception in aggregator!');
6560: END IF;
6561: -- clear previous warnings
6562: p_except_counter := 0;
6563: p_except_deal_no.DELETE;

Line 6617: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','QRM_ANA_NO_SETTING',

6613: p_except_token_name(p_except_counter) := 'ANALYSIS_NAME';
6614: p_except_token_value(p_except_counter) := p_analysis_name;
6615: --bug 3236479
6616: IF (g_proc_level>=g_ERROR_level) THEN
6617: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','QRM_ANA_NO_SETTING',
6618: 'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS',
6619: g_error_level);
6620: END IF;
6621: WHEN e_analysis_in_progress THEN

Line 6647: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','QRM_ANA_RUN_IN_PROGRESS',

6643: p_except_token_name(p_except_counter) := 'ANALYSIS';
6644: p_except_token_value(p_except_counter) := p_analysis_name;
6645: --bug 3236479
6646: IF (g_proc_level>=g_ERROR_level) THEN
6647: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','QRM_ANA_RUN_IN_PROGRESS',
6648: 'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS',
6649: g_error_level);
6650: END IF;
6651: WHEN QRM_PA_AGGREGATION_P.e_pagg_no_fxrate_found THEN

Line 6677: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','QRM_CALC_NO_DEFAULT_SPOT_ERR',

6673: p_except_token_name(p_except_counter) := 'CCY';
6674: p_except_token_value(p_except_counter) := p_settings.curr_reporting;
6675: --bug 3236479
6676: IF (g_proc_level>=g_ERROR_level) THEN
6677: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','QRM_CALC_NO_DEFAULT_SPOT_ERR',
6678: 'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS',
6679: g_error_level);
6680: END IF;
6681: WHEN QRM_PA_AGGREGATION_P.e_pagg_no_timebuckets_found THEN

Line 6707: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','QRM_ANA_NO_TIMEBUCKETS',

6703: p_except_token_name(p_except_counter) := 'TB_NAME';
6704: p_except_token_value(p_except_counter) := p_settings.tb_name;
6705: --bug 3236479
6706: IF (g_proc_level>=g_ERROR_level) THEN
6707: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','QRM_ANA_NO_TIMEBUCKETS',
6708: 'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS',
6709: g_error_level);
6710: END IF;
6711: WHEN QRM_PA_AGGREGATION_P.e_pagg_no_setting_found THEN

Line 6737: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','QRM_PA_AGGREGATION_P.E_PAGG_NO_SETTING_FOUND',

6733: p_except_token_name(p_except_counter) := 'ANALYSIS_NAME';
6734: p_except_token_value(p_except_counter) := p_analysis_name;
6735: --bug 3236479
6736: IF (g_proc_level>=g_ERROR_level) THEN
6737: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','QRM_PA_AGGREGATION_P.E_PAGG_NO_SETTING_FOUND',
6738: 'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS',
6739: g_error_level);
6740: END IF;
6741: WHEN others THEN

Line 6764: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','QRM_ANA_UNEXPECTED_ERROR outer',

6760: p_except_error_type(p_except_counter) := 'E';
6761: p_except_error_code(p_except_counter) := 'QRM_ANA_UNEXPECTED_ERROR';
6762: --bug 3236479
6763: IF (g_proc_level>=g_ERROR_level) THEN
6764: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','QRM_ANA_UNEXPECTED_ERROR outer',
6765: 'QRM_PA_CALCULATIONS_P.RUN_ANALYSIS',
6766: g_error_level);
6767: END IF;
6768: END;

Line 6777: XTR_RISK_DEBUG_PKG.dlog('DML','UPDATED LAST RUN DATE AND CALC STATUS IN SETTINGS TABLE',

6773: SET last_run_date = p_ref_datetime, status = retcode
6774: WHERE analysis_name = p_analysis_name;
6775:
6776: IF (g_event_level>=g_debug_level) THEN --bug 3236479
6777: XTR_RISK_DEBUG_PKG.dlog('DML','UPDATED LAST RUN DATE AND CALC STATUS IN SETTINGS TABLE',
6778: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_event_level);
6779: END IF;
6780:
6781: -- UPDATE ERRORS TABLE

Line 6788: XTR_RISK_DEBUG_PKG.dlog('DML','Deleted qrm_deal_calc_errors',

6784: FROM qrm_deal_calc_errors
6785: WHERE analysis_name=p_analysis_name;
6786:
6787: IF (g_event_level>=g_debug_level) THEN --bug 3236479
6788: XTR_RISK_DEBUG_PKG.dlog('DML','Deleted qrm_deal_calc_errors',
6789: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_event_level);
6790: END IF;
6791:
6792: -- now insert new errors into table

Line 6810: XTR_RISK_DEBUG_PKG.dlog('DML','Inserted new errors into table',

6806:
6807: COMMIT;
6808:
6809: IF (g_event_level>=g_debug_level) THEN --bug 3236479
6810: XTR_RISK_DEBUG_PKG.dlog('DML','Inserted new errors into table',
6811: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_event_level);
6812: END IF;
6813:
6814: -- if no rows returned, reset retcode to '1'

Line 6821: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'retcode is: '||retcode);

6817: retcode := '1';
6818: END IF;
6819:
6820: IF (g_proc_level>=g_debug_level) THEN
6821: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'retcode is: '||retcode);
6822: XTR_RISK_DEBUG_PKG.dpop(null,'QRM_CALCULATION_P.RUN_ANALYSIS'); --bug3236479;
6823: END IF;
6824:
6825: END run_analysis;

Line 6822: XTR_RISK_DEBUG_PKG.dpop(null,'QRM_CALCULATION_P.RUN_ANALYSIS'); --bug3236479;

6818: END IF;
6819:
6820: IF (g_proc_level>=g_debug_level) THEN
6821: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'retcode is: '||retcode);
6822: XTR_RISK_DEBUG_PKG.dpop(null,'QRM_CALCULATION_P.RUN_ANALYSIS'); --bug3236479;
6823: END IF;
6824:
6825: END run_analysis;
6826:

Line 6840: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_CALCULATION_P.GET_SIGNED_AMOUNT'); --bug3236479;

6836:
6837: BEGIN
6838:
6839: IF (g_proc_level>=g_debug_level) THEN
6840: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_CALCULATION_P.GET_SIGNED_AMOUNT'); --bug3236479;
6841: END IF;
6842:
6843: -- BOND: sign amount outstanding,maturity amount,gap amount,accrued interest
6844: -- NI: sign all except accrued interest (accrued interest is 0)

Line 6875: XTR_RISK_DEBUG_PKG.dpop(null,'QRM_CALCULATION_P.GET_SIGNED_AMOUNT'); --bug3236479;

6871: END IF;
6872: END IF;
6873:
6874: IF (g_proc_level>=g_debug_level) THEN
6875: XTR_RISK_DEBUG_PKG.dpop(null,'QRM_CALCULATION_P.GET_SIGNED_AMOUNT'); --bug3236479;
6876: END IF;
6877:
6878: return p_signed_amount;
6879: END get_signed_amount;

Line 6952: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_PA_CALCULATIONS_P.get_gap_date'); --bug 3236479

6948: p_gap_date DATE;
6949:
6950: BEGIN
6951: IF (g_proc_level>=g_debug_level) THEN
6952: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_PA_CALCULATIONS_P.get_gap_date'); --bug 3236479
6953: END IF;
6954:
6955: OPEN get_deal_data;
6956: FETCH get_deal_data INTO p_deal_maturity_date, p_fixed_until_date;

Line 6969: XTR_RISK_DEBUG_PKG.dlog('get_gap_date: ' || 'deal no: '||p_deal_no);

6965: END IF;
6966: END LOOP;
6967:
6968: IF (g_proc_level>=g_debug_level) THEN
6969: XTR_RISK_DEBUG_PKG.dlog('get_gap_date: ' || 'deal no: '||p_deal_no);
6970: END IF;
6971: IF (p_initial_basis='FLOAT') THEN -- floating
6972: p_gap_date := p_trans_maturity_date;
6973: IF (g_proc_level>=g_debug_level) THEN

Line 6974: XTR_RISK_DEBUG_PKG.dlog('get_gap_date: ' || 'initial basis is float');

6970: END IF;
6971: IF (p_initial_basis='FLOAT') THEN -- floating
6972: p_gap_date := p_trans_maturity_date;
6973: IF (g_proc_level>=g_debug_level) THEN
6974: XTR_RISK_DEBUG_PKG.dlog('get_gap_date: ' || 'initial basis is float');
6975: END IF;
6976: ELSIF(p_deal_type='IRS' and p_initial_basis='FIXED') THEN
6977: p_gap_date := NULL;
6978: IF (g_proc_level>=g_debug_level) THEN

Line 6979: XTR_RISK_DEBUG_PKG.dlog('get_gap_date: ' || 'IRS and initial basis is fixed');

6975: END IF;
6976: ELSIF(p_deal_type='IRS' and p_initial_basis='FIXED') THEN
6977: p_gap_date := NULL;
6978: IF (g_proc_level>=g_debug_level) THEN
6979: XTR_RISK_DEBUG_PKG.dlog('get_gap_date: ' || 'IRS and initial basis is fixed');
6980: END IF;
6981: ELSIF ((p_fixed_until_date IS NULL) OR
6982: (p_fixed_until_date=p_deal_maturity_date)) THEN -- fixed
6983: IF (g_proc_level>=g_debug_level) THEN

Line 6984: XTR_RISK_DEBUG_PKG.dlog('get_gap_date: ' || 'fixed until date: '||p_fixed_until_date);

6980: END IF;
6981: ELSIF ((p_fixed_until_date IS NULL) OR
6982: (p_fixed_until_date=p_deal_maturity_date)) THEN -- fixed
6983: IF (g_proc_level>=g_debug_level) THEN
6984: XTR_RISK_DEBUG_PKG.dlog('get_gap_date: ' || 'fixed until date: '||p_fixed_until_date);
6985: END IF;
6986: p_gap_date := p_deal_maturity_date;
6987: ELSE
6988: IF (g_proc_level>=g_debug_level) THEN

Line 6989: XTR_RISK_DEBUG_PKG.dlog('get_gap_date: ' || 'gap date else');

6985: END IF;
6986: p_gap_date := p_deal_maturity_date;
6987: ELSE
6988: IF (g_proc_level>=g_debug_level) THEN
6989: XTR_RISK_DEBUG_PKG.dlog('get_gap_date: ' || 'gap date else');
6990: XTR_RISK_DEBUG_PKG.dlog('get_gap_date: ' || 'fixed until date', p_fixed_until_date);
6991: END IF;
6992: OPEN get_others(p_fixed_until_date);
6993: FETCH get_others INTO p_trans_maturity_date;

Line 6990: XTR_RISK_DEBUG_PKG.dlog('get_gap_date: ' || 'fixed until date', p_fixed_until_date);

6986: p_gap_date := p_deal_maturity_date;
6987: ELSE
6988: IF (g_proc_level>=g_debug_level) THEN
6989: XTR_RISK_DEBUG_PKG.dlog('get_gap_date: ' || 'gap date else');
6990: XTR_RISK_DEBUG_PKG.dlog('get_gap_date: ' || 'fixed until date', p_fixed_until_date);
6991: END IF;
6992: OPEN get_others(p_fixed_until_date);
6993: FETCH get_others INTO p_trans_maturity_date;
6994: IF (get_others%FOUND) THEN

Line 7002: XTR_RISK_DEBUG_PKG.dpop(null,'QRM_PA_CALCULATIONS_P.get_gap_date'); --bug 3236479;

6998: END IF;
6999: CLOSE get_others;
7000: END IF;
7001: IF (g_proc_level>=g_debug_level) THEN
7002: XTR_RISK_DEBUG_PKG.dpop(null,'QRM_PA_CALCULATIONS_P.get_gap_date'); --bug 3236479;
7003: END IF;
7004:
7005: RETURN p_gap_date;
7006: END get_gap_date;

Line 7022: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_PA_CALCULATIONS.convert_amounts');--bug3236479

7018: p_md_out XTR_MARKET_DATA_P.md_from_set_out_rec_type;
7019:
7020: BEGIN
7021: IF (g_proc_level>=g_debug_level) THEN
7022: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_PA_CALCULATIONS.convert_amounts');--bug3236479
7023: END IF;
7024: p_md_in.p_md_set_code := p_mds;
7025: p_md_in.p_source := 'C';
7026: p_md_in.p_indicator := 'S';

Line 7033: XTR_RISK_DEBUG_PKG.dlog('convert_amounts: ' || p_from_ccy||'/'||p_to_ccy||' spot rate:'||p_md_out.p_md_out);

7029: p_md_in.p_contra_ccy := p_to_ccy;
7030: p_md_in.p_side := 'M';
7031: XTR_MARKET_DATA_P.get_md_from_set(p_md_in, p_md_out);
7032: IF (g_proc_level>=g_debug_level) THEN
7033: XTR_RISK_DEBUG_PKG.dlog('convert_amounts: ' || p_from_ccy||'/'||p_to_ccy||' spot rate:'||p_md_out.p_md_out);
7034: END IF;
7035: p_to_amount := p_from_amount*p_md_out.p_md_out;
7036: IF (g_proc_level>=g_debug_level) THEN
7037: XTR_RISK_DEBUG_PKG.dlog('convert_amounts: ' || p_from_ccy||' amount:'||p_from_amount);

Line 7037: XTR_RISK_DEBUG_PKG.dlog('convert_amounts: ' || p_from_ccy||' amount:'||p_from_amount);

7033: XTR_RISK_DEBUG_PKG.dlog('convert_amounts: ' || p_from_ccy||'/'||p_to_ccy||' spot rate:'||p_md_out.p_md_out);
7034: END IF;
7035: p_to_amount := p_from_amount*p_md_out.p_md_out;
7036: IF (g_proc_level>=g_debug_level) THEN
7037: XTR_RISK_DEBUG_PKG.dlog('convert_amounts: ' || p_from_ccy||' amount:'||p_from_amount);
7038: XTR_RISK_DEBUG_PKG.dlog('convert_amounts: ' || p_to_ccy||' amount:'||p_to_amount);
7039: XTR_RISK_DEBUG_PKG.dpop(null,'QRM_PA_CALCULATIONS.convert_amounts');--bug3236479
7040: END IF;
7041: END convert_amounts;

Line 7038: XTR_RISK_DEBUG_PKG.dlog('convert_amounts: ' || p_to_ccy||' amount:'||p_to_amount);

7034: END IF;
7035: p_to_amount := p_from_amount*p_md_out.p_md_out;
7036: IF (g_proc_level>=g_debug_level) THEN
7037: XTR_RISK_DEBUG_PKG.dlog('convert_amounts: ' || p_from_ccy||' amount:'||p_from_amount);
7038: XTR_RISK_DEBUG_PKG.dlog('convert_amounts: ' || p_to_ccy||' amount:'||p_to_amount);
7039: XTR_RISK_DEBUG_PKG.dpop(null,'QRM_PA_CALCULATIONS.convert_amounts');--bug3236479
7040: END IF;
7041: END convert_amounts;
7042:

Line 7039: XTR_RISK_DEBUG_PKG.dpop(null,'QRM_PA_CALCULATIONS.convert_amounts');--bug3236479

7035: p_to_amount := p_from_amount*p_md_out.p_md_out;
7036: IF (g_proc_level>=g_debug_level) THEN
7037: XTR_RISK_DEBUG_PKG.dlog('convert_amounts: ' || p_from_ccy||' amount:'||p_from_amount);
7038: XTR_RISK_DEBUG_PKG.dlog('convert_amounts: ' || p_to_ccy||' amount:'||p_to_amount);
7039: XTR_RISK_DEBUG_PKG.dpop(null,'QRM_PA_CALCULATIONS.convert_amounts');--bug3236479
7040: END IF;
7041: END convert_amounts;
7042:
7043:

Line 7081: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_PA_CALCULATIONS_P.remove_expired_deals');--bug 3236479

7077:
7078:
7079: BEGIN
7080: IF (g_proc_level>=g_debug_level) THEN
7081: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_PA_CALCULATIONS_P.remove_expired_deals');--bug 3236479
7082: END IF;
7083: -- collect calculated matured deals
7084: FOR cursor_rec IN get_expired_ids LOOP
7085: p_counter := p_counter + 1;

Line 7130: XTR_RISK_DEBUG_PKG.dpop(null,'QRM_PA_CALCULATIONS_P.remove_expired_deals');--bug3236479

7126: WHERE deal_no=p_deal_nos(i) AND transaction_no=p_transaction_nos(i);
7127:
7128: COMMIT;
7129: IF (g_proc_level>=g_debug_level) THEN
7130: XTR_RISK_DEBUG_PKG.dpop(null,'QRM_PA_CALCULATIONS_P.remove_expired_deals');--bug3236479
7131: END IF;
7132: END remove_expired_deals;
7133:
7134:

Line 7173: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_PA_CALCULATIONS_P.filter_measure');--bug3236479

7169:
7170: BEGIN
7171:
7172: IF (g_proc_level>=g_debug_level) THEN
7173: XTR_RISK_DEBUG_PKG.dpush(null,'QRM_PA_CALCULATIONS_P.filter_measure');--bug3236479
7174: END IF;
7175:
7176: --only filter measure for Crosstab and Crosstab with Timebuckets
7177: IF p_style IN ('X','C') THEN

Line 7236: XTR_RISK_DEBUG_PKG.dpop(v_where,'QRM_PA_CALCULATIONS_P.filter_measure');--bug3236479

7232: v_where := NULL;
7233: END IF;
7234:
7235: IF (g_proc_level>=g_debug_level) THEN
7236: XTR_RISK_DEBUG_PKG.dpop(v_where,'QRM_PA_CALCULATIONS_P.filter_measure');--bug3236479
7237: END IF;
7238:
7239: RETURN v_where;
7240: EXCEPTION

Line 7244: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','UNEXPECTED',

7240: EXCEPTION
7241: WHEN OTHERS THEN
7242: --bug 3236479
7243: IF (g_proc_level>=g_ERROR_level) THEN
7244: XTR_RISK_DEBUG_PKG.dlog('EXCEPTION','UNEXPECTED',
7245: 'QRM_PA_CALCULATIONS_P.FILTER_MEASURE',
7246: g_error_level);
7247: END IF;
7248: