Method for modifying computer system and system resulting therefrom6044371Abstract The invention provides a calendar interface system associated with a host computer for returning date-compliant data to an application running remotely from the host and requesting date data and a method for modifying such systems to be date compliant. Claims What is claimed is: Description BACKGROUND OF THE INVENTION
TABLE 1
__________________________________________________________________________
Data Field
Data Item Length
Description Type
__________________________________________________________________________
CRB-RC full word
Return Code (RC) - code signifying whether
Input
(binary)
operation requested was successful, and if not,
then containing an error code
CRB-OPT half word
Option (OPT) - the option number corresponds
Input
(binary)
to a predetermined requested operation from the
CIS
CRB-COUNT half word
As Input - specifies magnitude and direction
Input
(binary)
scroll request relative to pointer position in
orS
database Output
As Output - returns from CIS number of event
occurences counted (or other specified data)
CRB-EVENT A/N Specifies Event symbol that identifies the
Input
Len(12)
particular calendar to be used when an event-
oriented request is invoked of the CIS
CRB-INDATE1
A/N As Input - a date-from-program, or a date
Input
Len(10)
translation request from the CIS, in date
orput
format Output
As Output - whenever a date validation is
requested form the CIS, returns a date in full
Gregorian format (YYYYMMDD)
CRB-INDATE2
A/N Specifies the other limit of the date when
Input
Len(10)
range of dates is specified for an event-related
request.
CRB-FORMAT
A/N Specifies the format (mask) of the date data
Input
Len(3)
to and returned from the CIS; if not specified,
and
YYYYMMDD can be specified as default
Output
CRB-VALUE A/N Resultant date data from a query command
Output
Len(12)
CRB-CLENDAR-
(Group- N/A???
DATA Item)
CRB-WEEKDAY
Z/D Len(1)
The day of the week of the date returned
Output
the CIS is encoded as a digit (e.g., Sunday = 1,
Saturday = 7)
CRB-WEEK-YEAR
Z/D Len(2)
The numerical value of the week with respect
Output
the approx. 53 weeks in a year, returned as
value from 1 to 53.
CRB-WEEK-MONTH
Z/D Len(1)
The numerical value of the week with respect
Output
the number of weeks in a given month, returned
as a value ranging from 1 to 5.
CRB-BUSINESS
Z/D Len(3)
The number of the Business day in the calendar
Output
year that corresponds to the date being
validated; returns zero(es) if the date being
validated is not a business day; depending upon
the calendar used by the CIS.
CRB-DAYS-LEFT
Z/D Len(3)
The number of calendar days occurring between
Output
the date validated (excluding the validated date)
until the last day of the year; ranges from 000 to
364 (and to 365 for leap years).
__________________________________________________________________________
Once a CRB is defined and the CIS is invoked by passing the CRB along with operands and control data to the CIS, the CIS performs the operations on the operands with reference to a separately addressable calendar database ("CDB" hereinafter). The CDB is preferably a read-only storage area, that is maintained and updated separately from the CIS. The CDB contains databases of calendars, including data indicating special holidays, business days, other important days, and the like, as generally associated with a calendar. The CDB may contain separate database calendars for the USA, for Europe, for Japan, and for other areas or markets. Each of these calendar databases may include different information, such as legal and financial holidays in each locale, which days of the week are business days, and the like. Further, each CDB calendar can have coded therein information about other one-time, occasional, and/or periodic occurrences. For example, "events" can be added to define one or a set of days as corresponding to a particular event (e.g., quarterly earnings for a particular industry typically being reported on such days or dates). An "event" can be considered as a real occurrence having logical annotations distributed throughout the CDB. One or more types or catagories of events can be included, and a heirarchy can be defined for the events. Such a heirarchy preferably allows a type of event heirarchically higher to be modelled on one or more heirarchically lower event definitions. Further, a group of related events can be defined with respect to previously defined specific events. Analogously, aliases can be used as a sort of indirect addressing for a particular business calendar, event, or event group. The CIS performs the function required by the dependent application by querying the CDB. A preferred set of query commands is listed in Table 2. The query commands are based on the position and control of a virtual pointer in the CDB.
TABLE 2
__________________________________________________________________________
FUNCTION NAME FUNCTION DESCRIPTION/RESULT
__________________________________________________________________________
CHECK BUSINESS is the pointer pointed to a business day
CHECK SETTLEMENT
is the pointer pointed to a Settlement Day, or is there
one or
more Settlement Days in the days within a pointer range
CHECK HOLIDAY is the pointer pointed to a corporate business holiday,
or is there
one or more corporate business holidays in the days
within a
pointer range
CHECK BANK HOLIDAY
is the pointer pointed to a bank holiday, or is there one
or more
bank holidays in the days within a pointer range
CHECK LOCAL HOLIDAY
is the pointer pointed to a local holiday, or are one or
more local
holidays in the days within a pointer range
EVENT CHECK check for the occurrence of a specific event at the
pointer
EVENT COUNT count the number of occurrences of a specific event over
a range
of dates
EVENT SCROLL scroll the calendar over a specific number of occurrences
of a
specific event.
COUNT CALENDAR DAYS
count the number of actual calendar days occurring within
a
specific range of dates
COUNT BUSINESS DAYS
count the number of business days occurring within a
specific
range of dates
COUNT SETTLEMENT DAYS
count the number of settlement days occurring within a
specific
range of dates
COUNT EVENT FOR YEAR
count the number of specific event occurrences during a
particular year
COUNT EVENT FOR QUARTER
count the number of specific event occurrences during a
specific
quarter (three consecutive months) of particular year
COUNT EVENT FOR MONTH
count the number of specific event occurrences during a
particular month
SCROLL YEARS scroll the calendar a specific number of yearly
increments
SCROLL MONTHS scroll the calendar a specific number of monthly
increments
SCROLL WEEKS scroll the calendar a specific number of weekly
increments
SCROLL DAYS scroll the calendar a specific number of days
SCROLL BUSINESS DAYS
scroll the calendar a specific number of business days
SCROLL SETTLEMENT DAYS
scroll the calendar a specific number of settlement days
SCROLL BUSINESS HOLIDAYS
scroll the calendar a specific number of business
holidays
POINT TO START OF YEAR
position the pointer at the start of the year currently
referenced
POINT TO START OF MONTH
position the pointer at the start of the month currently
referenced
POINT TO END OF MONTH
position the pointer at the end of the month currently
referenced
POINT TO START OF WEEK
position the pointer at the first day of the week
currently
referenced
POINT TO END OF WEEK
position the pointer at the last day of the week
currently
referenced
POINT TO START OF
position the pointer at the first day of the quarter
currently
QUARTER referenced
POINT TO END OF QUARTER
position the pointer at the last day of the quarter
currently
referenced
POINT TO CURRENT DATE
position the pointer at the current system date
POINT TO CURRENT BUSINESS
position the pointer at the current business day
DAY
__________________________________________________________________________
To implement the various calendaring functions, such as those shown in Table 2, the CIS preferably has a front end that includes a driver, interpreter, or other preprocessor or translator to allow a user or a dependent application program to invoke one or more of the CIS functions with call commands that appear like those in commonly used programming languages (from COBOL and C++, as mentioned above, to "macro" languages as might be part of an application program). Imagining, for example, a calendar as an infinite scroll of monthly wall calendars, these call commands are generally related (a) to pointing at a particular date or a particular reference date or a range of dates and (b) to moving to, or with respect to, a particular date or a particular reference date or range of dates. Examples of particular reference dates include: the first or last day of a month or year; the first or last business day of a week, month, or year; holidays; predefined important days (e.g., April 15 (tax payment day), days when government reports are released, days when government paper is sold, etc.); a customer's effective end of month date for purposes of interest or distribution payments; and other events as might be desired. Examples of invoking the calendaring functions are shown below. In "request mode," the dependent application uses the common CRB area to preform the necessary date calculation. A sample calculation is: MOVE +32 to CRB-OPT MOVE `customer` to CRB-EVENT MOVE +2 to CRB-COUNT MOVE `M01` to CRB-FORMAT CALL `CIS` using CALENDAR-REQUEST-BLOCK END-CALL MOVE CRB-VALUE to MY-OUTDATE In this example, the CRB-OPT is a listed option of various CIS functions, here to scroll a defined number of events (EVENT SCROLL in Table 2) and here the particular event is (arbitrarily) the customer's end of month date; the number of events to be scrolled through is two in the forward direction; and the date data is to be returned in a format defined by mask M01. After this information is passed to the CRB, the CIS is called to operate on the data pursuant to the parameters, and the result is stored in a CRB block called value; the result is then moved into the local workspace (MY-OUTDATE) to be used by the dependent application. The CIS can also be invoked in a "command mode" in which parameters are passed to the CIS rather than stored in a common workspace. The same sample calculation could be written as follows:
______________________________________
01 MY-OUTDATE PIC X(10)
01 PARAMETERS
02 ESCROLL PIC X(08) VALUE `ESCROLL`
02 CUSTOMER PIC X(12) VALUE `CUSTOMER`
02 M01 PIC X(03) VALUE `M01`
02 FW02 PIC X S9(08)
VALUE +2
. . .
CALL `CIS` USING ESCROLL CUSTOMER FW02 MY-OUTDATE
M01 END-CALL
______________________________________
The "ESCROLL" parameter is a shorthand for the "EVENT SCROLL" function listed in Table 2. The command mode call syntax shown lists serially the application (CIS), the operands (customer, direction of scrolling (forward by 2)), the variable name in which the CIS should store the result (MY-OUTDATE), and the date format mask (M01). It is preferred in this "command mode" that any intermediate calculation date be stored locally at the CIS and unavailable to the dependent application calling the CIS. The invention can also be implemented in a "function mode" identical to the command mode except that intermediate values and data are stored locally at the workstation. As an example of the sequence of operations occuring at an application program invoking the CIS for a particular financial operation is shown in FIG. 2. This example is for the operation of creating reports on the fourth Thursday of each month of monthly IRA (individual retirement account) distributions. The program (or subroutine) starts 201 and opens a stored data file 203 containing records of monthly IRA distributions. A call is made to the CIS to return the system date 205 (such as with the SYSDATE command in Table 3), and then to return the fourth Thursday in the current month 207. The system (current) date and the date of the fourth Thursday are compared 209. If the system date is the fourth Thursday, then another program is invoked 211 to create the records for the IRA monthly distribution, and those records are written to a file 213, and the files are closed 215 and the program terminates 217. If the system date is not the fourth Thursday, the files are closed 215 and the program terminates 217. Another example of the CIS working in combination an application program is returning the first and last business days in a given month. FIG. 3 depicts a flow chart for returning the first and last business days of the current month. The program starts 301 and a call 303 is made to the CIS ("CORPCAL") using the commands shown in Table 3 to locate the starting day of the month (ELOCATE STRMO, the command to locate the start date of the actual month). The pointer from the last call being at the first day of the month, another call 305 is made to scroll forward to the first business day of the month (CSCROLLI BUSINESS FW01), which is returned to the application program. With the pointer now residing on the first business day of the month, the pointer is scrolled 307 to the last actual day of the week of the first business day of the month, and then scrolled backwards 309 to the last business day of that week. From there the pointer is scrolled weekly 311 to the last actual day of the month and then scrolled backwards 313 to the last business day of the month, which is returned to the application program. The program then terminates 315, with the first and last business days of the month having been sent to the requesting application program. To assure Y2K compliant date data is returned to dependent applications, it is preferred that the CIS accept both compliant and non-compliant data as input and that the output be forced into a date-compliant mask, otherwise an error code will be returned to the calling application. Still further, the present method can facilitate accepting non-compliant input data by using a `moving window` of dates assumed to be compliant. For example, the present year is 1997. The CIS is programmed to assume that any two digit representation of the year date as input from "80" to "19" is a date ranging from 1980 to 2019, and that any other two digit representation of the input year date, namely "20" to "79", is part of the twenty-first century from 2020 to 2079. Accordingly, this scheme provides a twenty year window in which certain two digit year date input is assumed to reside in this century and otherwise in the next century. When the next year (1998) arrives, the CIS will read the change in the year in the system date and automatically shift the window up, so that two digit year dates between "81" and "20" will be assumed to range from 1981 to 2020 and otherwise from 2021 to 2080. Because the CIS utilizes a CDB and performs intermediate calculations, it is also possible for the CIS to process a request to provide a multicomponent output file for later use by an application. Such a "date record file" can include serially arranged data, for example: the key date for the current record stored as a Gregorian date (8 bytes); the key date in Lilian format (8 bytes); the key date in Julian format (8 bytes); the day of the week of the key date (1 to 7; 1 byte); the number of week of the year in which the key date falls (1 to 52; 2 bytes); the week of the month in which the key date falls (1 to 5; 1 byte); the days remaining in the year subsequent to the key date (1 to 365; 2 bytes); the numeric business day of the year of the key date (1 to 260; 2 bytes); the number of calendar days after a previous event (e.g., customer's end of month for interest calculations, 1 to 31; 2 bytes); and so on (or empty space). The foregoing description is meant to be illustrative and not limiting. Various changes, modifications, and additions may become apparent to the skilled artisan upon a perusal of this specification, and such are meant to be within the scope and spirit of the invention as defined by the claims.
|
Same subclass Same class Consider this |
||||||||||
