Search Results calc_days_run
Overview
XTR_CALC_P is a Treasury Risk Management (ETRM) calculation package owned by APPS and defined with AUTHID CURRENT_USER, meaning its SQL executes under the privileges of the invoking session rather than the definer. The package encapsulates the date-count and financial mathematics that underpin interest accrual, coupon processing, and bond valuation across the ETRM product set. Its central responsibility is to derive two fundamental values used in nearly every cash-flow computation: the number of days between two dates and the applicable year basis. These outputs feed coupon accrual, settlement amount derivation, and yield or price calculation for fixed-income instruments.
The package is classified as OTHER rather than as a public API, indicating it is intended primarily for internal use by the ETRM application and by dependent packages rather than as a supported integration surface for external callers. It is a high-fan-in object: the metadata records that 21 other packages reference it, confirming its role as a shared calculation utility.
Key Procedures and Functions
Seven documented procedures constitute the package interface.
- CALC_DAYS_RUN_C — The most fully parameterized day-count routine. It accepts start and end dates, a calculation method, a frequency, forward adjustment and day-count-type indicators, and a first-transaction flag. Day count and year basis are returned as IN OUT NOCOPY parameters, a pattern chosen for performance because it avoids parameter copying in a routine called repeatedly during batch processing.
- CALC_DAYS_RUN_B — A streamlined variant of the same computation, taking only dates, method, and frequency, with the two IN OUT NOCOPY result parameters. It represents the minimal-argument form of the day-count calculation.
- CALC_DAYS_RUN — The general-purpose entry point for day-count and year-basis derivation, supporting forward adjustment, day-count type, and first-transaction handling. This is the procedure most commonly invoked by dependent packages.
- CALCULATE_BOND_PRICE_YIELD — The principal valuation routine. Given a bond issue code and settlement date, together with ex/cum-coupon status and a price-or-yield indicator, it returns yield, accrued interest, clean price, and dirty price. Supporting parameters describe commencement and maturity dates, previous and next coupon dates, calculation and year-calc types, accrued-interest basis, coupon frequency, rounding rules for calculation, price, and yield, the rounding type, and the coupon rate.
- CALCULATE_BOND_COUPON_AMOUNTS — Derives coupon amount values for a bond, building on the coupon-date and issue data held in the referenced tables.
- RECALC_DT_DETAILS — Recomputes deal-date level detail, typically after an upstream change to dates or calculation basis requires recalculation of derived amounts.
- CALC_DAYS_RUN_IG — A day-count variant associated with interest-rate or interest-guarantee processing within the ETRM calculation flow.
Tables Accessed
The package reads and writes the following tables through APPS synonyms:
- XTR_BOND_ISSUES — Master bond definition data supplying coupon rates, frequency, and calculation conventions.
- XTR_BOND_COUPON_DATES — Generated coupon schedule dates used in price, yield, and accrued-interest computation.
- XTR_DEALS — Deal-level records for which date counts and amounts are calculated.
- XTR_DEAL_DATE_AMOUNTS — The date-level amount rows that RECALC_DT_DETAILS refreshes.
- XTR_ROLLOVER_TRANSACTIONS — Rollover transaction data affecting accrual periods.
- XTR_TAX_BROKERAGE_SETUP — Tax and brokerage configuration that influences net settlement amounts.
Usage Notes
XTR_CALC_P is normally invoked indirectly. ETRM forms and concurrent programs that process deals, bonds, coupons, and rollovers call the package to obtain day counts and year bases before computing monetary amounts. Custom extensions and reports requiring identical day-count behaviour should call these procedures rather than reimplementing the logic, ensuring consistency with standard ETRM accrual. Because the package runs with AUTHID CURRENT_USER, callers must hold appropriate privileges on the underlying XTR tables, and because results are returned through IN OUT NOCOPY parameters, callers must supply initialized variables and expect them to be modified in place. Given the 21 dependent packages, changes to these signatures carry broad regression risk and should be validated across the full ETRM calculation chain.
-
PACKAGE: APPS.XTR_CALC_P
12.2.2
-
PACKAGE: APPS.XTR_CALC_P
12.1.1
-
PACKAGE: APPS.XTR_MM_COVERS
12.1.1
-
PACKAGE: APPS.XTR_MM_COVERS
12.2.2
-
PACKAGE BODY: APPS.XTR_CALC_P
12.1.1
-
PACKAGE BODY: APPS.XTR_CALC_P
12.2.2
-
PACKAGE BODY: APPS.XTR_MM_COVERS
12.1.1
-
PACKAGE BODY: APPS.XTR_MM_COVERS
12.2.2
-
APPS.XTR_CALC_P dependencies on XTR_CALC_P
12.2.2
-
APPS.XTR_CALC_P dependencies on XTR_CALC_P
12.1.1
-
APPS.XTR_MM_COVERS dependencies on XTR_CALC_P
12.2.2
-
APPS.XTR_CALC_P dependencies on XTR_MM_COVERS
12.1.1
-
APPS.XTR_MM_COVERS dependencies on XTR_CALC_P
12.1.1
-
APPS.XTR_CALC_P dependencies on XTR_MM_COVERS
12.2.2
-
APPS.XTR_MM_COVERS dependencies on XTR_MM_COVERS
12.2.2
-
APPS.XTR_MM_COVERS dependencies on XTR_MM_COVERS
12.1.1
-
PACKAGE BODY: APPS.XTR_ACCRUAL_PROCESS_P
12.2.2
-
PACKAGE BODY: APPS.XTR_ACCRUAL_PROCESS_P
12.1.1