7.2 Managing Annual Activities
OFSBD requires that you perform certain calendar management tasks at least annually: loading holidays and weekly off-days from an Oracle client. This ensures that OFSBD has the necessary information for populating its own business calendars.
Loading Holidays
On an annual basis, you must populate holidays for the upcoming calendar year into the Behavior Detection KDD_CAL_HOLIDAY database table. This ensures that the table contains holidays for at least the next year.
INSERT INTO KDD_CAL_HOLIDAY ( CLNDR_NM, CLNDR_DT, HLDY_NM,
HLDY_TYPE_CD ) VALUES ( 'SYSCAL', TO_DATE( '01/01/2017',
'MM/DD/YYYY'), 'New Year''s Day - 2017', 'C');
INSERT INTO KDD_CAL_HOLIDAY ( CLNDR_NM, CLNDR_DT, HLDY_NM,
HLDY_TYPE_CD ) VALUES ( 'SYSCAL', TO_DATE( '01/16/2017',
'MM/DD/YYYY'), 'Martin Luther King Jr.''s Birthday - 2017', 'C');
INSERT INTO KDD_CAL_HOLIDAY ( CLNDR_NM, CLNDR_DT, HLDY_NM,
HLDY_TYPE_CD ) VALUES ( 'SYSCAL', TO_DATE( '02/20/2017',
'MM/DD/YYYY'), 'President''s Day - 2017', 'C');
INSERT INTO KDD_CAL_HOLIDAY ( CLNDR_NM, CLNDR_DT, HLDY_NM,
HLDY_TYPE_CD ) VALUES ( 'SYSCAL', TO_DATE( '04/14/2017',
'MM/DD/YYYY'), 'Good Friday - 2017', 'C');
INSERT INTO KDD_CAL_HOLIDAY ( CLNDR_NM, CLNDR_DT, HLDY_NM,
HLDY_TYPE_CD ) VALUES ( 'SYSCAL', TO_DATE( '05/29/2017',
'MM/DD/YYYY'), 'Memorial Day - 2017', 'C');
INSERT INTO KDD_CAL_HOLIDAY ( CLNDR_NM, CLNDR_DT, HLDY_NM,
HLDY_TYPE_CD ) VALUES ( 'SYSCAL', TO_DATE( '07/04/2017',
'MM/DD/YYYY'), 'Independence Day - 2017', 'C');
INSERT INTO KDD_CAL_HOLIDAY ( CLNDR_NM, CLNDR_DT, HLDY_NM,
HLDY_TYPE_CD ) VALUES ( 'SYSCAL', TO_DATE( '09/04/2017',
'MM/DD/YYYY'), 'Labor Day - 2017', 'C');
INSERT INTO KDD_CAL_HOLIDAY ( CLNDR_NM, CLNDR_DT, HLDY_NM,
HLDY_TYPE_CD ) VALUES ( 'SYSCAL', TO_DATE( '11/22/2017',
'MM/DD/YYYY'), 'Thanksgiving Day - 2017', 'C');
INSERT INTO KDD_CAL_HOLIDAY ( CLNDR_NM, CLNDR_DT, HLDY_NM,
HLDY_TYPE_CD ) VALUES ( 'SYSCAL', TO_DATE( '12/25/2017',
'MM/DD/YYYY'), 'Christmas Day - 2017', 'C');
COMMIT;
Table 7-1 KDD_CAL_HOLIDAY Table
Column Name | Description |
---|---|
CLNDR_NM | Specific calendar name. |
CLNDR_DT | Date that is a holiday. |
HLDY_NM | Holiday name , such as Thanksgiving or Christmas. |
HLDY_TYPE_CD | Indicates whether the business is Closed (C) or Shortened (S). |
SESSN_OPN_TM | Indicates the opening time of the trading session for a shortened day. The format is HHMM. |
SESSN_CLS_TM | Indicates the closing time of the trading session for a shortened day. The format is HHMM. |
SESSN_TM_OFFSET_TX | Indicates the timezone offset for SESSN_OPN_TMand SESSN_CLS_TM. |
When the system runs the set_mantas_date.sh script
, it queries the
KDD_CAL_HOLIDAY table for the maximum date for each calendar in the table.
Note:
If the maximum date is less than 90 days ahead of the provided date, the process logs a warning message that the specific calendar’s future holidays need updating. If any calendars have no holiday records, the system logs a Warning message that the specific calendar has no recorded holidays for the appropriate date range.Loading Non-business Days
Note:
By default, the system identifies Saturdays and Sundays as non-business days in the system calendar (SYSCAL).The following table describes the contents of the KDD_CAL_WKLY_OFF table.
Table 7-2 KDD_CAL_WKLY_OFF
Column Name | Description |
---|---|
CLNDR_NM | Specific calendar name. |
DAY_OF_WK | Value that represents the day of the week: Sunday=1, Monday=2, Tuesday=3,Wednesday=4, Thursday=5, Friday=6, Saturday=7. |
Note:
If the table does not contain records for any calendar in the list, the system logs a Warning message that the specific calendar contains no weekly off-days.