Software date and time services6317746Abstract A program product performs date and time services for a calling program. The program product accepts multiple date and time inputs, multiple date and time input and output formats, and multiple function requests. A windowing function is performed to determine a century value for a date that lacks a century designator. Gregorian, Julian, ADABAS D, ADABAS T, EIBDATE, and other formats are supported. Formats may also be parameterized for individual functions allowing a calling program to select multiple and diverse formats for a sequence of called functions. Version checking and version tracking are also supported to insure the calling program interfaces with a version of the program product having an expected functionality. A method provides the functionality of the program product, receiving calls from a calling program. Another method embodies a calling program performing date and time operations by invoking a date and time services program. Claims What is claimed is: Description BACKGROUND OF THE INVENTION
*01 (KQDTS)-DATE-TIME-SERVICES.
*--------------------------------------------------------------------------
---------
(KQDTS)-DATE-TIME-SERVICE S COMMUNICATION AREA
*--------------------------------------------------------------------------
--
05 (KQDTS)-BLOCK-DETAILS.
07 (KQDTS)-PROGRAM-NAME PIC X(08).
88 (KQDTS)-BLOCK-ID-CICS VALUE `KQDTSOP1`.
88 (KQDTS)-BLOCK-ID-BATCH VALUE `KQDTSOB1`.
07 (KQDTS)-PROGRAM-VERSION PIC X(06).
88 (KQDTS)-BLOCK-VERSION VALUE `V01.00`.
07 (KQDTS)-PROGRAM-LINKAGE AREA PIC 9(08).
88 (KQDTS)-BLOCK-LENGTH VALUE 700.
*--------------------------------------------------------------------------
--
INPUT BLOCK REQUIRED FOR THIS PROGRAM
*--------------------------------------------------------------------------
--
05 (KQDTS)-IN-DATA.
07 (KQDTS)-IN-REQ-FUNC-AREA PIC X(08).
88 (KQDTS)-REQ-FUNC-CURR-DT-TIM VALUE `CUR.100`.
88 (KQDTS)-REQ-FUNC-CURR-DTM-D VALUE `CUR.101`.
88 (KQDTS)-REQ-FUNC-CURR-DTM-T VALUE `CUR.102`.
88 (KQDTS)-REQ-FUNC-CURR-DTM-D-T VALUE `CUR.103`.
88 (KQDTS)-REQ-FUNC-DT-WINDOW VALUE `WIN.100`.
88 (KQDTS)-REQ-FUNC-DT-WINDOW-D VALUE `WIN.101`.
88 (KQDTS)-REQ-FUNC-DT-WINDOW-T VALUE `WIN.102`.
88 (KQDTS)-REQ-FUNC-CALL-SQTODATE VALUE `TOD.100`.
88 (KQDTS)-REQ-FUNC-CALL-SQFRDATE VALUE `FRD.100`.
88 (KQDTS)-REQ-FUNC-CALL-SQTOTIME VALUE `TOT.100`.
88 (KQDTS)-REQ-FUNC-CALL-SQFRTIME VALUE `FRT.100`.
88 (KQDTS)-REQ-FUNC-DT-ADD-DAYS VALUE `ADD.100`.
88 (KQDTS)-REQ-FUNC-DT-DIF-DAYS VALUE `DIF.100`.
88 (KQDTS)-REQ-FUNC-DT-COMPR-DT VALUE `COM.100`.
88 (KQDTS)-REQ-FUNC-DT-SUB-DAYS VALUE `SUB.100`.
88 (KQDTS)-REQ-FUNC-DT-VALIDATE VALUE `VAL.100`.
88 (KQDTS)-REQ-FUNC-DT-CONVERT VALUE `CON.100`.
88 (KQDTS)-REQ-FUNC-DAY-OF-WEEK VALUE `DOW.100`.
88 (KQDTS)-REQ-FUNC-DTM-VALIDAT VALUE `DTM.100`.
88 (KQDTS)-REQ-FUNC-TIM-VALIDAT VALUE `TIM.100`.
88 (KQDTS)-REQ-FUNC-LEAPYR-CHEK VALUE `LYR.100`.
88 (KQDTS)-REQ-FUNC-DAYS-IN-MON VALUE `DIM.100`.
88 (KQDTS)-REQ-FUNC-ADD-DT-TIME VALUE `ADT.100`.
88 (KQDTS)-REQ-FUNC-SUB-DT-TIME VALUE `SDT.100`.
88 (KQDTS)-REQ-FUNC-DIF-DT-TIME VALUE `DDT.100`.
07 (KQDTS)-IN-FUTURE-USE-00 PIC X(5).
07 (KQDTS)-IN-NUM-DATES PASSED PIC 9.
88 (KQDTS)-NUM-OF-DATES VALUE 1 THRU 5.
07 (KQDTS)-IN-FUTURE-USE-01 PIC X(50).
07 (KQDTS)-IN-DATE-TIME OCCURS 5 TIMES.
10 (KQDTS)-IN-DATE FORMAT PIC X(05).
88 (KQDTS)-YYMMDD VALUE `YMD `
88 (KQDTS)-CCYYMMDD VALUE `CYMD `
88 (KQDTS)-ADAT VALUE `ADAT `
88 (KQDTS)-ADAD VALUE `ADAD `
88 (KQDTS)-YYDDD VALUE `5JJ `
88 (KQDTS)-YYMM VALUE `YM `
88 (KQDTS)-MMDDYY VALUE `MDY `
88 (KQDTS)-DDMMYY VALUE `DMY `
88 (KQDTS)-YEAR VALUE `YEAR `
88 (KQDTS)-S-YYMMDD VALUE `SYMD `
88 (KQDTS)-S-MMDDYY VALUE `SMDY `
88 (KQDTS)-S-DDMMYY VALUE `SDMY `
88 (KQDTS)-MMDDCCYY VALUE `MDCY `
88 (KQDTS)-DDMMCCYY VALUE `DMCY `
88 (KQDTS)-S-CCYYMMDD VALUE `SCYMD `
88 (KQDTS)-S-MMDDCCYY VALUE `SMDCY `
88 (KQDTS)-S-DDMMCCYY VALUE `SDMCY `
88 (KQDTS)-S-YYMM VALUE `SYM `
88 (KQDTS)-S-YYDDD VALUE `55JJ `
88 (KQDTS)-S-CCYYDDD VALUE `57JJ `
88 (KQDTS)-S-CCYYMM VALUE `SCYM `
88 (KQDTS)-CCYYDDD VALUE `7JJ `
88 (KQDTS)-CCYYMM VALUE `CYM `
88 (KQDTS)-CHARACTER VALUE `CHAR `
10 (KQDTS)-IN-DATE-TIME-RC PIC 9(03).
10 (KQDTS)-IN-DATE PIC X(20) JUST
RIGHT
10 (KQDTS)-IN-TIME PIC X(12).
10 FILLER REDEFINES (KQDTS)-IN-TIME.
12 (KQDTS)-IN-HOUR PIC 9(02).
12 (KQDTS)-IN-MIN PIC 9(02).
12 (KQDTS)-IN-SEC PIC 9(02).
12 (KQDTS)-IN-MILLI-SEC PIC 9(03).
12 (KQDTS)-IN-FUTURE-SEC PIC 9(03).
10 FILLER REDEFINES (KQDTS)-IN-TIME.
12 (KQDTS)-IN-HHHMMSS PIC 9(06).
12 FILLER PIC 9(06).
10 FILLER REDEFINES (KQDTS)-IN-TIME.
12 (KQDTS)-IN-HHHMMSSTEN PIC 9(07).
12 FILLER PIC9 (05).
10 FILLER REDEFINES (KQDTS)-IN-TIME.
12 (KQDTS)-IN-HHHMMSSHUN PIC 9(08).
12 FILLER PIC9(04).
10 FILLER REDEFINES (KQDTS)-IN-TIME.
12 (KQDTS)-IN-HHHMMSSMIL PIC 9(09).
12 FILLER PIC9(03).
07 (KQDTS)-IN-TIME-FOR-CALC PIC 9(09).
07 FILLER REDEFINES (KQDTS)-IN-TIME-FOR-CALC.
10 (KQDTS)-IN-DAYS-FOR-CALC PIC 9(09).
07 (KQDTS)-IN-TIME-FLAG-CALC PIC X.
88 (KQDTS)-HR-PARM VALUE `H`.
88 (KQDTS)-MM-PARM VALUE `M`.
88 (KQDTS)-SS-PARM VALUE `S`.
07 (KQDTS)-IN-FUTURE-USE-02 PIC X(40).
*------------------------------------------------------------------------
OUTPUT BLOCK FOR THE CALLING PROGRAM
*------------------------------------------------------------------------
05 (KQDTS)-OUT-DATA.
07 (KQDTS)-OUT-DIFFERENCE-IN-DAYS PIC 9(05).
07 (KQDTS)-OUT-DAYS-IN-MONTH PIC 9(02).
88 (KQDTS)-DIM VALUE 1 THRU 31.
07 (KQDTS)-OUT-LEAP-YEAR-FLAG PIC X.
88 (KQDTS)-LEAP-YEAR VALUE `Y`.
88 (KQDTS) -NON-LEAP-YEAR VALUE `N`.
07 (KQDTS)-OUT-VALIDATE-FLAG PIC X.
88 (KQDTS)-VALIDATION-PASS VALUE `Y`.
88 (KQDTS)-VALIDATION-FAIL VALUE `N`.
07 (KQDTS)-OUT-COMPARE-FLAG PIC X.
88 (KQDTS)-FIRST-DATE-GREATER VALUE `>`.
88 (KQDTS)-FIRST-DATE-LESSER VALUE `<`.
88 (KQDTS)-DATES-ARE-EQUAL VALUE `=`.
07 (KQDTS)-OUT-DAY-OF-WEEK PIC X.
88 (KQDTS)-SUNDAY VALUE `1`.
88 (KQDTS)-MONDAY VALUE `2`.
88 (KQDTS)-TUESDAY VALUE `3`.
88 (KQDTS)-WEDNESDAY VALUE `4`.
88 (KQDTS)-THURSDAY VALUE `5.`
88 (KQDTS)-FRIDAY VALUE `6`.
88 (KQDTS)-SATURDAY VALUE `7`.
07 (KQDTS)-OUT-CURRENT-ABSTIME PIC 9(15).
07 (KQDTS)-OUT-CURRENT-DTM.
10 (KQDTS)-OUT-CURRENT-DATE-JUL PIC 9(07).
10 FILLER REDEFINES (KQDTS)-OUT-CURRENT-DATE-JUL.
12 (KQDTS)-OUT-CURR-CCYY PIC 9(04).
12 (KQDTS)-OUT-CURR-DDD PIC 9(03).
10 (KQDTS)-OUT-CURRENT-DATE PIC 9(08).
10 FILLER REDEFINES (KQDTS)-OUT-CURRENT-DATE.
12 (KQDTS)-CURRENT-CCYY PIC 9(04).
12 (KQDTS)-CURRENT-MM PIC 9(02).
12 (KQDTS)-CURRENT-DD PIC 9(02).
10 (KQDTS)-OUT-CURRENT-TIME PIC 9(12).
10 FILLER REDEFINES (KQDTS)-OUT-CURRENT-TIME.
12 (KQDTS)-OUT-CURR-HR PIC 9(02).
12 (KQDTS)-OUT-CURR-MIN PIC 9(02).
12 (KQDTS)-OUT-CURR-SEC PIC 9(02).
12 (KQDTS)-OUT-CURR-MILLISEC PIC 9(03).
12 FILLER PIC 9(03).
10 FILLER REDEFINES (KQDTS)-OUT-CURRENT-TIME.
12 (KQDTS)-OUT-CURR-HHMMSSMIL PIC 9(09).
12 FILLER PIC 9(03).
10 FILLER REDEFINES (KQDTS)-OUT-CURRENT-TIME.
12 (KQDTS)-OUT-CURR-HHMMSSHUN PIC 9(08).
12 FILLER PIC 9(04).
10 FILLER REDEFINES (KQDTS)-OUT-CURRENT-TIME.
12 (KQDTS)-OUT-CURR-HHMMSSTEN PIC 9(07).
12 FILLER PIC 9(05).
10 FILLER REDEFINES (KQDTS)-OUT-CURRENT-TIME.
12 (KQDTS)-OUT-CURR-HHMMSS PIC 9(06).
12 FILLER PIC 9(06).
07 (KQDTS)-OUT-FUTURE-USE-01 PIC X(65).
07 (KQDTS)-OUT-DATE-TIME OCCURS 5 TIMES.
10 (KQDTS)-OUT-DATE PIC 9(08).
10 FILLER REDEFINES (KQDTS)-OUT-DATE.
12 (KQDTS)-OUT-CCYYMMDD PIC 9(08).
10 FILLER REDEFINES (KQDTS)-OUT-DATE.
12 (KQDTS)-OUT-CCYYMM PIC 9(06).
12 FILLER PIC 9(02).
10 FILLER REDEFINES (KQDT S)-OUT-DATE.
12 (KQDTS)-OUT-CCYY PIC 9(04).
12 FILLER PIC 9(04).
10 FILLER REDEFINES (KQDTS)-OUT-DATE.
12 FILLER PIC 9(01).
12 (KQDTS)-OUT-JULIAN-CCYYDDD PIC 9(07).
10 (KQDTS)-OUT-TIME PIC 9(12).
10 FILLER REDEFINES (KQDTS)-OUT-TIME.
12 (KQDTS)-OUT-HOUR PIC 9(02).
12 (KQDTS)-OUT-MIN PIC 9(02).
12 (KQDTS)-OUT-SEC PIC 9(02).
12 (KQDTS)-OUT-MILLISEC PIC 9(03).
12 (KQDTS)-OUT-FUTURE-SEC PIC 9(03).
10 FILLER REDEFINES (KQDTS)-OUT-TIME.
12 (KQDTS)-OUT-HHMMSSMIL PIC 9(09).
12 FILLER PIC 9(03).
10 FILLER REDEFINES (KQDTS)-OUT-TIME.
12 (KQDTS)-OUT-HHMMSSHUN PIC 9(08).
12 FILLER PIC 9(04).
10 FILLER REDEFINES (KQDTS)-OUT-TIME.
12 (KQDTS)-OUT-HHMMSSTEN PIC 9(07).
12 FILLER PIC 9(05).
10 FILLER REDEFINES (KQDTS)-OUT-TIME.
12 (KQDTS)-OUT-HHMMSS PIC 9(06).
12 FILLER PIC 9(06).
10 (KQDTS)-OUT-D-FORMAT PIC 9(07).
10 (KQDTS)-OUT-T-FORMAT PIC 9(13).
07 (KQDTS)-OUT-FUTURE-USE-02 PIC X(46).
01 (R)-INFORMATION.
10 (R)-BLOCK-DATA.
15 (R)-BLOCK.
88 (R)-BLOCK-ID
VALUE `KQSEBVCCV01.00`.
20 (R)-BLOCK-NAME PIC X(008)
VALUE `KQSEBVCC`.
88 (R)-BLOCK-NAME-ID
VALUE `KQSEBVCC`.
20 (R)-BLOCK-VER PIC X(006)
VALUE `V01.001`.
88 (R)-BLOCK-VER-ID VALUE `V01.00`.
15 (R)-BLOCK-LEN PIC 9(008)
VALUE 452.
88 (R)-BLOCK-LENGTH
VALUE 452.
15 (R)-BLOCK-FILLER PIC X(015).
10 (R)-CD-DATA.
15 (R)-CD-SEVERITY.
20 (R)-CD-SEVERITY-SIGN PIC X(001).
88 (R)-CD-SEVERITY-PLUS
VALUE `+`
88 (R)-CD-SEVERITY-MINUS
VALUE `-`
20 (R)-CD-SEVERITY-VAL PIC 9(002).
88 (R)-CD-SEVERITY-NONE
VALUE 0.
88 (R)-CD-SEVERITY-INFORM
VALUE 4.
88 (R)-CD-SEVERITY-WARNING
VALUE 8.
88 (R)-CD-SEVERITY-FATAL
VALUE 12.
88 (R)-CD-SEVERITY-MAJOR
VALUE 16.
15 (R)-CD-RESPONSE.
20 (R)-CD-RESPONSE-SIGN PIC X(001).
88 (R)-CD-RESPONSE-PLUS
VALUE `+` `
88 (R)-CD-RESPONSE-MINUS
VALUE `-`
20 (R)-CD-RESPONSE-VAL PIC 9(008).
15 (R)-CD-SUPP.
20 (R)-CD-SUPP-SIGN PIC X(001).
88 (R)-CD-SUPP-PLUS
VALUE `+` `
88 (R)-CD-SUPP-MINUS
VALUE `-`
20 (R)-CD-SUPP-VAL PIC 9(008).
15 (R)-CD-FILLER PIC X(015).
The first data element group in the source code listing, (KQDTS)-BLOCK-DETAILS, defines the name of the program, the version of the program, and the size of the data block. In this listing, the program name for the services sub-program that processes calls for an on-line calling program is "KQDTSOP1". Likewise, the name for the services sub-program that processes calls from a batch calling program is called "KQDTSOB1". The program version indicated in a program version parameter as "V01.00". The second data element group included in the source code listing, (KQDTS)-IN-DATA, includes the data descriptors for input data to the services program. Conditional data element (KQDTS)-IN-REQ-FUNC-AREA represents an 8-character field specifying the individual service function called by the calling program. (KQDTS)-IN-REC-FUNC-AREA is a conditional variable, and the twenty-five lines following this element specify condition-names corresponding to various supported service functions. Accordingly, if the value associated with (KQDTS)-IN-REQ-FUNC-AREA matches the value (e.g. CUR.100) corresponding to a condition-name, a path of execution associated with the matched condition-name is executed by the object program. Data element (KQDTS)-IN-FUTURE-USE-00 represents an additional block of memory allocated in the input block that may be utilized for future enhancements. Conditional data element (KQDTS)-IN-NUM-DATES-PASSED contains a single-digit value ranging from 1 to 5, as specified by the condition-name (KQDTS)-NUM-OF-DATES, and specifies the number of dates passed to the services program for processing by a WINDOWING function (e.g., "WIN.100") and other functions. Data element (KQDTS)-IN-FUTURE-USE-01 represents a block of memory allocated in the input block that may be utilized for future enhancements. Group data element (KQDTS)-IN-DATE-TIME represents a subgroup within the (KQDTS)-IN-DATA data group. (KQDTS)-IN-DATE-TIME defines a fixed-length table of five date/time data elements. Each date/time-related element includes four data elements: (KQDTS)-IN-DATE-FORMAT, (KQDTS)-IN-DATE-TIME-REC, (KQDTS)-IN-DATE, and (KQDTS)-IN-TIME. Conditional data element (KQDTS)-IN-DATE-FORMAT is a 5-character field that specifies the one of the 24 formats (listed in the subsequent condition-name statements) in which the input date can be passed to the -services program. In addition, the number and character of supported formats are not limited to the 24 formats shown but can be modified to support any desired set of formats. Data element (KQDTS)-IN-DATE-TIME-RC is a 3-digit field that holds the return code associated with an input date. In a preferred embodiment of the present invention, (KQDTS)-IN-DATE-TIME-RC is used in conjunction with COM.100, DIF.100, WIN.100, WIN.101, and WIN.102. In a different embodiment, it may be desirable to employ return codes for additional functions, and this variable may be used for that purpose. Conditional data element (KQDTS)-IN-DATE is a 20-character field that holds the input date, provided by the calling program, on which the services program is to perform its operation. For all services program functions, if the input date lacks a century designator, the function performs a WINDOWING function using a pivot year to determine an appropriate century value. Data element (KQDTS)-IN-TIME is a 12-character field that holds the input time, provided by the calling program, on which the services program is to perform its operation. The "REDEFINES" statements that follow the initial data description entry for the (KQDTS)-IN-TIME data element provide alternative data description entries for the (KQDTS)-IN-TIME data element. Data element (KQDTS)-IN-TIME-FOR-CALC contains a 9-digit numeric value passed by the application program to add a certain amount of time to or to subtract a certain amount of time from a given input date-time data element when executing ADD or SUB date/time services. In a preferred embodiment, the data element is also redefined as (KQDTS)-IN-DAYS-FOR-CALC to represent a certain number of days to be added to or subtracted from the input date/time value. Data element (KQDTS)-IN-FUTURE-USE-02 represents an additional block of memory allocated in the input block that may be utilized for future enhancements. In the output block included in the source code listing, (KQDTS)-OUT-DATA defines a group element containing output data elements and groups. Data element (KQDTS)-OUT-DIFFERENCE-IN-DAYS is a 5-digit field that stores the difference (in number of days) between two input dates passed by the application program. This data element is populated by the services program only a DIFFERENCE function (e.g., "DIF.100"), which requires two input dates and/or times, is used. Conditional data element (KQDTS)-OUT-DAYS-IN-MONTH is a 2-digit field that stores the number of days in the month associated with the input date received from the calling program. For example, if a calling program passes a date representing Oct. 28, 1995, the services program will populate the (KQDTS)-OUT-DAYS-IN-MONTH field with the number "31". Condition name (KQDTS)-DIM specifies the condition that the (KQDTS)-OUT-DAYS-IN-MONTH data element be a number between 1 and 31. Conditional data element (KQDTS)-OUT-LEAP-YEAR-FLAG is a flag value passed to the calling program to indicate whether the input date passed to the service program was a leap year. The condition names following the (KQDTS)-OUT-LEAP-YEAR-FLAG statement specify the expected values for (KQDTS)-OUT-LEAP-YEAR-FLAG. Conditional data element (KQDTS)-OUT-VALIDATE-FLAG is a flag passed to the calling program indicating whether the input date or input time passed to the VALIDATION function (i.e., "VAL.100") in the service program was valid. Other functions that perform validations also get this flag as appropriate. In addition, the two condition names that follow the (KQDTS)-OUT-VALIDATE-FLAG statement define expected values for the (KQDTS)-OUT-VALIDATE-FLAG data element. Conditional data element (KQDTS)-OUT-COMPARE-FLAG is a flag value passed to the calling program indicating one of three conditions (specified in the subsequent source code lines). This flag is set at the completion of a COMPARE (i.e., "COM.100") function, which require two input dates. If the first input date is greater than the second input date, then the (KQDTS)-FIRST-DATE-GREATER condition is met, and the (KQDTS)-OUT-COMPARE-FLAG data element equals `>`. If the first input date is less than the second input date, then the (KQDTS)-FIRST-DATE-LESSER condition is satisfied, and the (KQDTS)-OUT-COMPARE-FLAG equals `<`. When both input dates are equal, then condition (KQDTS)-DATES-ARE-EQUAL is satisfied and (KQDTS)-OUT-COMPARE-FLAG equals `=`. Conditional data element (KQDTS)-OUT-DAY-OF-WEEK is a flag value generated by a "DAY OF WEEK" function (i.e., "DOW.100") and passed to the application program indicating the day of the week of the input date, where, as specified by the subsequent condition statements, `1` represents Sunday, `2` represents Monday, and so on. The input date passed to the service program, in a preferred embodiment of the present invention, must be a full Gregorian or Julian date. Furthermore, the (KQDTS)-OUT-DAY-OF-WEEK data element uses `1900` as the base year, so the date passed to the service program must be greater than `1900` to produce valid results. In other embodiments, any alternative base year or input date format may be supported. Data element (KQDTS)-OUT-CURRENT-ABSTIME is a 15-digit field containing a CICS ASKTIME value. The service program populates this data element when invoked by an online calling program, such as a program executed in the CICS environment. Group element (KQDTS)-OUT-CURRENT-DTM includes the following three data elements: (KQDTS)-OUT-CURRENT-DATE, (KQDTS)-OUT-CURRENT-TIME and (KQDTS)-OUT-CURRENT-DATE-JUL. As suggested by their labels, these data elements contain the current date in Gregorian format, the current time, and the current date in Julian format, respectively. The "current" date and time are defined as the date and time of returned by CICS ASKTIME for online calling programs or ACCEPT for batch calling programs. Each data element within (KQDTS)-OUT-CURRENT-DTM is associated with one or more data descriptions, as shown in the source code listing. The "REDEFINES" statements that follow the initial data description entry for the data elements in the (KQDTS)-CURRENT-DTM group provide alternative data description entries for the data elements. Data element (KQDTS)-OUT-FUTURE-USE-01 specifies allocated memory in the output block that may be utilized for future enhancements. Group data element (KQDTS)-OUT-DATE-TIME represents a subgroup within the (KQDTS)-OUT-DATA data group and defines a fixed-length table of five data/time output data elements. Each date/time data element includes four data elements: (KQDTS)-OUT DATE, (KQDTS)-OUT-TIME, (KQDTS)-OUT-D-FORMAT, and (KQDTS)-OUT-T-FORMAT. Conditional data element (KQDTS)-OUT-DATE is an 8-character field that specifies the result of the operation performed by the services program. If an input date in Gregorian format is passed to the services program, the corresponding (KQDTS)-OUT-DATE FORMAT is also a Gregorian format. Likewise, if the input date is in Julian format, the output date is also in Julian format. These corresponding formats are described by the "REDEFINES" statements that follow the data element statement. Data element (KQDTS)-OUT-TIME is a 12-digit field that holds that output time resulting from the operation of the services program. The various formats supported by this data element are described in the subsequent "REDEFINES" statements that follow the (KQDTS)-OUT-TIME data element statement. Data element (KQDTS)-OUT-D-FORMAT is a 7-digit field that holds the ADABAS D formatted date corresponding to the output date. In a preferred embodiment of the present invention, the date received through this field is a 9(7) field and not a Packed-Decimal field. Data element (KQDTS)-OUT-T-FORMAT is a 13-digit field that holds the ADABAS T-formatted date or time that results from the operation performed by the services program. In a preferred embodiment of the present invention, the date time received through this field is a 9(13) field and not a Packed-Decimal field. Data element (KQDTS)-OUT-FUTURE-USE-02 represents an additional block of memory allocated in the output block that may be utilized for future enhancements. The (R)-INFORMATION data block defines the error block, which is filled with data indicating the circumstances of an exception. Although not shown in listed source code, an alternative embodiment in accordance with the present invention includes the (KQDTS)-IN-REQ-FUNC-AREA data element in the (KQDTS)-DATE-TIME data group to allow the submission of multiple input/dates and multiple functions. In this manner, multiple and diverse functions on multiple date-time input data elements may be performed in a single call to the services program, enhancing performance of the calling program. Likewise, a date/time output format data element may be added to the (KQDTS)-IN-DATE-TIME data table to indicate the desired output format of the date/time operation's result. In this manner, a calling program may invoke a single function and select an output format from the set of supported output formats (e.g., Gregorian, Julian, ADABAS D, ADABAS T). For example, a Gregorian data can be input to a SUB.100. The calling program can specify an output date format of Julian, and the SUB.100 function will convert the SUB result into a Julian data format when it outputs the result to the calling program. In FIG. 5A, PROCESS FUNCTION block 404 of FIG. 4 is depicted in a flowchart, starting at block 502. The services program then proceeds to decision block 504, which determines whether the function identifier loaded in the (KQDTS)-IN-REQ-FUNC-AREA data element corresponds to the CURRENT DATE-TIME function ("CUR.100"). If so, the services program proceeds to block 506, which implements the CURRENT DATE-TIME function and returns the current date-time. The current date-time is obtained either by CICS ASKTIME for online calling programs or by COBOL ACCEPT for batch calling programs. The current date and time are output in the following data elements: (KQDTS)-OUT-CURRENT-DATE, (KQDTS)-OUT-CURRENT-TIME and (KQDTS)-OUT-CURRENT-DATE-JUL. Furthermore, if the calling program is an online program, the CICS ASKTIME value is output in (KQDTS)-OUT-CURRENT-ABSTIME. If the condition in decision block 504 is not met, the services program proceeds to decision block 508 to determine whether the requested function corresponds to CURRENT DATE-TIME & D-FORMAT DATE function in block 510. The CURRENT DATE-TIME & D-FORMAT DATE function ("CUR.101") returns the current date and time returned by CICS ASKTIME for online calling programs or by COBOL ACCEPT for batch calling programs. The current date and time are output in the following data elements: (KQDTS)-OUT-CURRENT-DATE, (KQDTS)-OUT-CURRENT-TIME and (KQDTS)-OUT-CURRENT-DATE-JUL. The current date value is also output in ADABAS D format in (KQDTS)-OUT-D-FORMAT. Furthermore, if the calling program is an online program, the CICS ASKTIME value is output in (KQDTS)-OUT-CURRENT-ABSTIME. If the condition in decision block 508 is not met, the services program proceeds to decision block 512 to determine whether the requested function corresponds to CURRENT DATE-TIME & T-FORMAT DATE function in block 514. The CURRENT DATE-TIME & T-FORMAT DATE function ("CUR.102") returns the current date and time returned by CICS ASKTIME for online calling programs or by COBOL ACCEPT for batch calling programs. The current date and time are output in the following data elements: (KQDTS)-OUT-CURRENT-DATE, (KQDTS)-OUT-CURRENT-TIME and (KQDTS)-OUT-CURRENT-DATE-JUL. The current date/time value is also output in ADABAS T format in (KQDTS)-OUT-T-FORMAT. Furthermore, if the calling program is an online program, the CICS ASKTIME value is output in (KQDTS)-OUT-CURRENT-ABSTIME. If the condition in decision block 512 is not met, the services program proceeds to decision block 516 to determine whether the requested function corresponds to CURRENT DATE-TIME & D-FORMAT AND T-FORMAT DATE function in block 518. The CURRENT DATE-TIME & D-FORMAT AND T-FORMAT DATE function ("CUR.103") returns the current date and time returned by CICS ASKTIME for online calling programs or by COBOL ACCEPT for batch calling programs. The current date and time are output in the following data elements: (KQDTS)-OUT-CURRENT-DATE, (KQDTS)-OUT-CURRENT-TIME and (KQDTS)-OUT-CURRENT-DATE-JUL. The current date/time value is also output in ADABAS D format in (KQDTS)-OUT-D-FORMAT and ADABAS T format in (KQDTS)-OUT-T-FORMAT. Furthermore, if the calling program is an online program, the CICS ASKTIME value is output in (KQDTS)-OUT-CURRENT-ABSTIME. If the condition in decision block 516 is not met, the services program proceeds to decision block 520 to determine whether the requested function corresponds to WINDOWING DATE function in block 522. The WINDOWING DATE function ("WIN.100") returns a date with a century designation based on a calculation using a pivot year (as described in FIGS. 8 through 11). The date is returned in Gregorian or Julian format. In a preferred embodiment, the function operates on up to five input dates, although an alternative embodiment could process any number of input dates in a single call to the WINDOWING DATE function. If the condition in decision block 520 is not met, the services program proceeds to decision block 524 to determine whether the requested function corresponds to WINDOWING DATE AND D-FORMAT function in block 526. The WINDOWING DATE AND D-FORMAT function ("WIN.101") returns a date with a century designation based on a calculation using a pivot year (as described in FIGS. 8 through 11). The date is returned in Gregorian or Julian format as well as ADABAS D format. In a preferred embodiment, the function operates on up to five input dates, although an alternative embodiment could process any number of input dates in a single call to the WINDOWING DATE AND D-FORMAT function. If the condition in decision block 524 is not met, the services program proceeds to decision block 528 to determine whether the requested function corresponds to WINDOWING DATE AND T-FORMAT function in block 530. The WINDOWING DATE AND T-FORMAT function ("WIN.102") returns a date with a century designation based on a calculation using a pivot year (as described in FIGS. 8 through 11). The date is returned in Gregorian or Julian format as well as ADABAS T format. In a preferred embodiment, the function operates on up to five input dates, although an alternative embodiment could process any number of input dates in a single call to the WINDOWING DATE AND T-FORMAT function. If the condition in decision block 528 is not met the services program proceeds to decision block 529 to determine whether the requested function corresponds to WINDOWING DATE AND D-FORMAT AND T-FORMAT function in block 531. The WINDOWING DATE AND D-FORMAT AND T-FORMAT function ("WIN.103") returns a date with a century designation based on a calculation using a pivot year (as described in FIGS. 8 through 11). The date is returned in Gregorian or Julian format as well as ADABAS D and ADABAS T formats. In a preferred embodiment, the function operates on up to five input dates, although an alternative embodiment could process any number of input dates in a single call to the WINDOWING DATE AND D-FORMAT AND T-FORMAT function. If the condition in decision block 529 is not met, the services program proceeds to decision block 532 to determine whether the requested function corresponds to CONVERT TO D-FORMAT DATE function in block 534. The CONVERT TO D-FORMAT DATE function ("TOD.100") converts an input date from a Gregorian or Julian format into ADABAS D format. In a preferred embodiment, the function operates on up to five input dates, although an alternative embodiment could process any number of input dates in a single call to the CONVERT TO D-FORMAT DATE function. If the condition in decision block 532 is not met, the services program proceeds to decision block 536 to determine whether the requested function corresponds to CONVERT FROM D-FORMAT DATE function in block 538. The CONVERT FROM D-FORMAT DATE function ("FRD.100") converts an input date from ADABAS D format to a Gregorian format. In a preferred embodiment, the function operates on up to five input dates, although an alternative embodiment could process any number of input dates in a single call to the CONVERT FROM D-FORMAT DATE function. If the condition in decision block 536 is not met, the services program proceeds to decision block 540 to determine whether the requested function corresponds to CONVERT TO T-FORMAT DATE function in block 542. The CONVERT TO T-FORMAT DATE function ("TOT.100") converts an input date-time value having a Gregorian or Julian date format and an HHMMSS time format into ADABAS T format. In a preferred embodiment, the function operates on up to five input date/time values, although an alternative embodiment could process any number of input dates in a single call to the CONVERT TO T-FORMAT DATE function. If the condition in decision block 540 is not met, the services program proceeds to decision block 544 to determine whether the requested function corresponds to CONVERT FROM T-FORMAT DATE function in block 546. The CONVERT FROM T-FORMAT DATE function ("FRT.100") converts an input date from ADABAS T format to a value having a Gregorian date format and an HHMMSS time format. In a preferred embodiment, the function operates on up to five input date/time values, although an alternative embodiment could process any number of input dates in a single call to the CONVERT FROM T-FORMAT DATE function. If the condition in decision block 544 is not met, the services program proceeds to decision block 548 to determine whether the requested function corresponds to ADD DAYS TO DATE function in block 550. The ADD DAYS TO DATE function ("ADD.100") adds the number of days passed to the services program in (KQDTS)-IN-DAYS-FOR-CALC to the input date passed in (KQDTS)-IN-DATE, which is in Gregorian or Julian format. The resulting (KQDTS)-OUT-DATE is also in Gregorian or Julian format, corresponding with the input date format. If the condition in decision block 548 is not met, the services program proceeds to decision block 552 to determine whether the requested function corresponds to DIFFERENCE BETWEEN TWO DATES function in block 554. The DIFFERENCE BETWEEN TWO DATES function ("DIF.100") calculates the difference between the first two input dates passed to the services program in the (KQDTS)-IN-DATE-TIME table, which are in Gregorian or Julian format. The resulting (KQDTS)-OUT-DIFFERENCE-IN-DAYS is a positive integer. If the condition in decision block 552 is not met, the services program proceeds to decision block 556 to determine whether the requested function corresponds to COMPARE TWO DATES function in block 558. The COMPARE TWO DATES function ("COM.100") compares the first two input dates passed to the services program in the (KQDTS)-IN-DATE table, which are in Gregorian or Julian format. The resulting (KQDTS)-COMPARE FLAG has the following possible value: `<`, `>`, and `=`, and the (KQDTS). OUT_DATE contains the greater of the two dates in Gregorian or Julian format (or the common date if the dates are equal). If the condition in decision block 556 is not met, the services program proceeds to decision block 560 to determine whether the requested function corresponds to SUBTRACT DAYS FROM DATE function in block 562. The SUBTRACT DAYS FROM DATE function ("SUB.100") subtracts the number of days passed to the services program in (KQDTS)-IN-DAYS-FOR-CALC from the input date passed in (KQDTS)-IN-DATE, which is in Gregorian or Julian format. The resulting (KQDTS)-OUT-DATE is also in Gregorian or Julian format, according to the input date format. If the condition in decision block 560 is not met, the services program proceeds to decision block 564 to determine whether the requested function corresponds to DATE VALIDATION function in block 566. The DATE VALIDATION function ("VAL.100") determines whether an input date in Gregorian format is a valid value by verifying that the "month" field is between 1 and 12 and that the "day" field is between 1 and 28, 29, 30, or 31, according to the appropriate month. Alternatively, if the input date is in Julian format, the DATE VALIDATION function determines whether the "day" field is between 1 and 365/366, based on a leap year check. If the input date is determined to be invalid, the (KQDTS)-OUT-VALIDATE-FLAG is set to `N` and the response code is set to a non-zero value. Otherwise, the date is determined to be valid, the KQDTS)-OUT-VALIDATE-FLAG is set to `Y`, and the response code is set to zero. If the condition in decision block 564 is not met, the services program proceeds to decision block 568 to determine whether the requested function corresponds to CONVERT JULIAN TO GREGORIAN AND GREGORIAN TO JULIAN function in block 570. The CONVERT JULIAN TO GREGORIAN AND GREGORIAN TO JULIAN function ("CON.100") performs one of the following functions: 1) If (KQDTS)-IN-DATE is in Gregorian format, the services program converts the date to Julian format; 2) If (KQDTS)-IN-DATE is in Julian format, the services program converts the date to Gregorian format; or 3) If (KQDTS)-IN-DATE is in EIBDATE format, the services program converts the date to Gregorian format based on the pivot year. EIBDATE format comprises a "day" value between 1 and 365/366 inclusive, based on a leap year check, a 2-digit year value, and a "century" value of `0` or `1` relative to the pivot year. Using a pivot year of 1968, for example, a "century" value of `0` represents the 20th century (the 1900's), whereas a "century" value of `1` represents the 21st century (the 2000's). If the condition in decision block 568 is not met, the services program proceeds to decision block 572 to determine whether the requested function corresponds to DAY OF WEEK function in block 574. The DAY OF WEEK function ("DOW.100") returns an integer value between 1 and 7 inclusive corresponding to the days of the week, where `1` represents Sunday. The input date may be in Gregorian or Julian format. If the condition in decision block 572 is not met, the services program proceeds to decision block 576 to determine whether the requested function corresponds to DATE-TIME VALIDATION function in block 578. The DATE-TIME VALIDATION function ("DTM.100") returns a `Y` in (KQDTS)-OUT-VALIDATE FLAG when the input date and time values are valid. A valid date value is defined in the same manner as described for the DATE VALIDATION function. A valid time value is defined as an HHMMSS000 formatted value, where HH is inclusive 0 and 23, MM is between 0 and 59, and SS is between 0 and 59 inclusive. If the condition in decision block 576 is not met, the services program proceeds to decision block 580 to determine whether the requested function corresponds to TIME VALIDATION function in block 582. The TIME VALIDATION function ("TIM.100") returns a `Y` in (KQDTS)-OUT-VALIDATE FLAG when the input time value is valid. A valid time value is defined as an HHMMSS000 formatted value, where HH is between 0 and 24 inclusive, MM is between 0 and 59 inclusive, and SS is between 0 and 59 inclusive. If the condition in decision block 580 is not met, the services program proceeds to decision block 584 to determine whether the requested function corresponds to LEAP YEAR CHECK function in block 586. The LEAP YEAR CHECK function ("LYR.100") validates a Gregorian or Julian input date passed by the calling program and returns a `Y` in (KQDTS)-OUT-LEAP-YEAR-FLAG if the input date is a leap year. If the condition in decision block 584 is not met, the services program proceeds to decision block 588 to determine whether the requested function corresponds to DAYS IN MONTH function in block 590. The DAYS IN MONTH function ("DIM.100") validates a Gregorian or Julian input date passed by a calling program and returns the number of days in the month corresponding to the input date. If the condition in decision block 588 is not met, the services program proceeds to decision block 592 to determine whether the requested function corresponds to ADD TIME TO DATE-TIME function in block 598. The ADD TIME TO DATE-TIME function ("ADT.100") adds an input time value passed to the services program in (KQDT)-IN-TIME-FOR-CALC (a 9-digit field) to the input date and time data elements passed to the services program. The input date is passed to the services program in Gregorian or Julian format. The time units of the (KQDT)-IN-TIME-FOR-CALC value is defined by a single-character (KQDTS)-IN-TIME-FLAG-CALC data element, indicating seconds (`S`), minutes (`M`), or hours (`H`). If the condition in decision block 592 is not met, the services program proceeds to decision block 501 to determine whether the requested function corresponds to SUBTRACT TIME FROM DATE-TIME function in block 503. The SUBTRACT TIME FROM DATE-TIME function ("SDT.100") subtracts an input time value passed to the services program in (KQDT)-IN-TIME-FOR-CALC (a 9-digit field) from the input date and time data elements passed to the services program. The input date is passed to the services program in Gregorian or Julian format. The time units of the (KQDT)-IN-TIME-FOR-CALC value are defined by a single-character (KQDTS)-IN-TIME-FLAG-CALC data element, indicating seconds (`S`), minutes (`M`), or hours (`H`). If the condition in decision block 501 is not met, the services program proceeds to decision block 505 to determine whether the requested function corresponds to DIFFERENCE BETWEEN TWO DATE-TIMES function in block 507. The DIFFERENCE BETWEEN TWO DATE-TIMES function ("DDT.100") calculates the difference between the first two input dates and times passed to the services program in the (KQDTS)-IN-DATE-TIME table. The input dates are passed to the services program in Gregorian or Julian format. The date and time values of each date-time pair are converted to a single date-time format before the difference is calculated by subtracting the lesser date-time value from the greater date-time value. The resulting (KQDTS)-OUT-DIFFERENCE-IN-DAYS is a positive integer. The non-integer portion of the difference is output in the (KQDTS)-OUT-TIME data element in HHMMSS000000 format. Block 594 provides the opportunity to extend the functions supported by the services program, Such extended functionality may or may not make use of the FUTURE-USE data elements described herein. The services program terminates at RETURN block 596 and returns to the calling program. FIGS. 6A through 6C illustrate an exemplary function supported by preferred embodiment of the present invention. In block 600, the WINDOWING function "WIN.101" commences and proceeds to decision block 602, which tests the number of input dates passed by the calling program. The illustrated WINDOWING function supports up to 5 input dates, but any number of input dates may be supported in accordance with the present invention. If the number of input dates exceeds the supported number of dates (e g., 5 dates) in this illustration), then the input data is moved to the error block described in the "(R)-INFORMATION" portion of the source code listed in this specification. If a supported number of input dates is received by the WIN.101 function, the processing enters loop 606 to sequentially process each of the dates. Block 608 moves an input date and input date format parameter corresponding to the current index in the loop to the working storage fields in the services program. If the input date format is not ADABAS D or ADABAS T format, decision block 610 directs processing to DATE-FORMAT AND DATE-INPUT CHECK block 614 to verify proper format and to validate the input date. Block 614 also performs the WINDOWING function based on the pivot year. If, however, the input date format is ADABAS D or ADABAS T format, decision block 610 directs processing to block 612 to set the output dates corresponding to the current index to zero, to move the output data to the error block, and to set a non-zero response code to indicate an exception. At completion of block 612, processing returns to block 608 after incrementing the index to process the next input date. In this fashion, the next date in the input date table is processed in each looping cycle. The same looping construct is employed after a successful input date processing operation, as shown by the arrow attached to connector "L". Such "looping" operation continues until all the dates in the input date table have been processed. After the processing in block 614 completes, decision block 616 tests to see if a valid date resulted from the WINDOWING function in block 614 was received in the input table. If not, processing moves to block 612 for exception processing. If the resulting date is valid, processing moves to decision block 618, which tests to determine whether the resulting date was in full Julian or full Gregorian date format. If the resulting date is not in full Julian or full Gregorian format, processing proceeds to block 612 for exception processing. If the resulting date is in full Julian or full Gregorian format, processing proceeds to block 622 to convert the resulting date to ADABAS D format. Thereafter, processing proceeds to decision block 624 to test the return code from the ADABAS conversion routine. If the conversion routine returns a non-zero return code, processing proceeds to block 612 for exception processing. If the return code from the ADABAS conversion routine equals zero, processing proceeds to block 626, which moves the resulting output date to the output date data element corresponding to the input date, moves the ADABAS-formatted output date to the corresponding data element for an ADABAS-formatted output date, and sets the response code to zero. If additional dates exist in the table to be processed, processing returns to block 608 after indexing the counter to operate on the next input date. This is shown in Figures 6A and 6D by the arrow attached to connector "L". If all the input dates in the input table are processed, operation proceeds to block 628 which terminates the loop, and decision block 630 evaluates whether all of the response codes equal zero. If all of the response codes equal zero, processing proceeds to block 632 to set the return code to zero and proceeds to RETURN block 636 to terminate the function. Alternatively, if one or more of the response codes does not equal zero, processing proceeds from decision block 630 to block 634 to set a non-zero return code and proceeds to RETURN block 636 terminating the function. In FIGS. 7A, 7B, and 7C, the DATE-FORMAT AND DATE-INPUT CHECK subroutine is illustrated. Decision blocks 702, 704, 706, and 708 test whether the input date is in one of four Julian date formats. If so, processing proceeds to block 710 for Julian date validation and windowing. After block 710, block 712 is executed, converting the Julian date to a Gregorian date. Thereafter, processing proceeds to block 760 in FIG. 7C to terminate the process. If the input date is not in Julian format, decision blocks 714 through 738 test the input date for one of 13 different Gregorian date formats. If the input date is in one of the supported Gregorian date formats, block 740 is executed to validate the date and perform the windowing process. Thereafter, block 742 converts the date from Gregorian format to Julian format and proceeds to block 760 to terminate the process. If the input date is in neither a supported Julian or a supported Gregorian format, decision blocks 744 through 750 evaluate whether the input date is in a "year-month" format. If so, processing proceeds to block 752 to perform YEAR-MONTH VALIDATION AND WINDOWING, and then processing proceeds to RETURN block 760 to terminate the process. If the input date does not match one of the previously-tested formats, processing proceeds to decision block 754 to test for a "year" format. If the input date matches the year format, processing proceeds to block 756 for YEAR VALIDATION AND WINDOWING, and then proceeds to RETURN block 760 to terminate the process. If, however, the input date has not matched any of the supported formats, processing proceeds to block 758 to set an invalid date flag, thereafter proceeding to RETURN block 760 to terminate the process. FIG. 8 illustrates the process of JULIAN DATE VALIDATION AND WINDOWING (block 710 of FIG. 7A). The process starts at block 800 and proceeds to block 802 to evaluate whether the input date is a non-negative number having a valid number of input days between zero and 367 exclusive. If not, processing proceeds to block 804, which sets an invalid date flag and returns to RETURN block 822. If the input date is validated, processing proceeds to decision block 806 to determine whether a century value is present. If not, processing proceeds to decision block 808 to compare the input date's year to a pivot year ("68" in a preferred embodiment of the present invention). If the input year is not less than the pivot year, processing proceeds to block 810 to assign a first century value ("19" in a preferred embodiment). If the input year is less than the pivot year, processing proceeds to block 812 to assign a second century value ("20" in a preferred embodiment). Note that the century values of "19" and "20" are used in this illustration, but any numerically adjacent century values may be used as appropriate. At the completion of blocks 810 and 812, processing proceeds to block 814 to check for a leap year. Thereafter, processing proceeds to decision block 816 to determine whether the number of days in the windowed year exceeds the maximum days in the particular century and year. If the input days exceed the valid number of days in the year, processing proceeds to block 818 to set an invalid date flag and proceeds to RETURN block 822 to terminate the process. Otherwise, a valid date flag is set in block 820, and the process proceeds to RETURN block 822 to terminate. FIG. 9 illustrates the process of GREGORIAN DATE VALIDATION AND WINDOWING (block 740 of FIG. 7A). The process starts at block 900 and proceeds to block 902 to evaluate whether the input date is a non-negative number having a valid number of input days between 1 and 31 inclusive and a valid number input months between 1 and 12 inclusive. If not, processing proceeds to block 904, which sets an invalid date flag and returns to RETURN block 922. If the input date is validated, processing proceeds to decision block 906 to determine whether a century value is present. If not, processing proceeds to decision block 908 to compare the input date's year to a pivot year ("68" in a preferred embodiment of the present invention). If the input year is not less than the pivot year, processing proceeds to block 910 to assign a first century value ("19" in a preferred embodiment). If the input year is less than the pivot year, processing proceeds to block 912 to assign a second century value ("20" in a preferred embodiment). Note that the century values of"19" and "20" are used in this illustration, but any numerically adjacent century values may be used as appropriate. At the completion of blocks 910 and 912, processing proceeds to block 914 to check for a leap year. Thereafter, processing proceeds to decision block 916 to determine whether the number of days in the windowed year exceeds the maximum days in the particular century and year. If the input days exceed the valid number of days in the year, processing proceeds to block 918 to set an invalid date flag and proceeds to RETURN block 922 to terminate the process. Otherwise, a valid date flag is set in block 920, and the process proceeds to RETURN block 922 to terminate. FIG. 10 illustrates the process of YEAR-MONTH VALIDATION AND WINDOWING (block 752 of FIG. 7C). The process starts at block 1000 and proceeds to block 1002 to evaluate whether the input date is a non-negative number having a valid number input months between 1 and 12 inclusive. If not, processing proceeds to block 1004, which sets an invalid date flag and returns to RETURN block 1018. If the input date is validated, processing proceeds to decision block 1006 to determine whether a century value is present. If not, processing proceeds to decision block 1008 to compare the input date's year to a pivot year ("68" in a preferred embodiment of the present invention). If the input year is not less than the pivot year, processing proceeds to block 1010 to assign a first century value ("19" in a preferred embodiment). If the input year is less than the pivot year, processing proceeds to block 1012 to assign a second century value ("20" in a preferred embodiment). Note that the century values of "19" and "20" are used in this illustration, but any numerically adjacent century values may be used as appropriate. At the completion of blocks 1010 and 1012, processing proceeds to block 1014 to check for a leap year. Processing then proceeds to block 1016 to set a valid date flag and to RETURN block 1018 for termination. FIG. 11 illustrates the process of YEAR VALIDATION AND WINDOWING (block 756 of FIG. 7C). The process starts at block 1100 and proceeds to block 1102 to evaluate whether the input date is numeric and non-negative. If not, processing proceeds to block 1104, which sets an invalid date flag and returns to RETURN block 1118. If the input date is validated, processing proceeds to decision block 1106 to determine whether a century value is present. If not, processing proceeds to decision block 1108 to compare the input date's year to a pivot year ("68" in a preferred embodiment of the present invention). If the input year is not less than the pivot year, processing proceeds to block 1110 to assign a first century value ("19" in a preferred embodiment). If the input year is less than the pivot year, processing proceeds to block 1112 to assign a second century value ("20" in a preferred embodiment). Note that the century values of "19" and "20" are used in this illustration, but any numerically adjacent century values may be used as appropriate. At the completion of blocks 1110 and 1112, processing proceeds to block 1114 to check for a leap year. Processing then proceeds to block 1116 to set a valid date flag and to RETURN block 1118 for termination. FIG. 12 illustrates the LEAP YEAR CHECK process (blocks 814 in FIG. 8, 914 in FIG. 9, 1014 in FIG. 10, and 1114 and FIG. 11) starting with block 1200, which receives an input date having a 2-digit year value and a 2-digit century value. Processing then proceeds to block 1202, which combines the century and year values and divides the combined century-year value by four, yielding a first remainder value (REMAINDER1). In decision block 1204, if the year value equals zero, processing proceeds to block 1206 to divide the combined century-year value by 400, yielding a second remainder value (REMAINDER2). In block 1208, if REMAINDER1 equal zero and REMAINDER2 equals zero, processing proceeds to block 1210, which moves the Value "366" to a data element holding the maximum number of days in a year and sets a flag indicating that the combined century-year value is a leap year. If block 1208 determines that either REMAINDER1 or REMAINDER2 does not equal zero, processing proceeds to block 1212, which moves the value "365" to a data element holding the maximum days in the year and sets a flag indicating that the year is not a leap year. In decision block 1216, if REMAINDER1 equals zero, processing proceeds to block 1210 to indicate that the year is a leap year. Also, from decision block 1216, if REMAINDER1 does not equal zero, processing proceeds to block 1212 to indicate the year is not a leap year. At the completion of blocks 1210 and 1212, processing proceeds to RETURN block 1220 to terminate. Other functions in a preferred embodiment relate to date/time functions and multiple time zones. Similar to CURRENT DATE-TIME function ("CUR.100"), which returns the current date and time based on a CICS ASKTIME call for on-line calling programs or a COBOL ACCEPT call for batch calling programs, the TZ CURRENT DATE-TIME function determines the current data and time applicable in a target time zone. Input parameters representing the current time zone and the target time zone are provided by the calling program. Alternatively, the current time zone parameter can be determined automatically, such as through an operating system call. The TZ CURRENT DATE-TIME function determines the current date and time in the current time zone and adjusts them by an appropriate number of hours according to the target time zone. The adjustment may alter both current date and time values in the target time zone. Time zones may be specified by a time zone code, a country code, a city code, or some other parameter. Moreover, any function using a current date and time can populate a resulting time zone output parameter to specify the proper time zone for the result. Likewise, the CURRENT TIME ZONE function accepts input parameters indicating the current time zone and a positive or negative number of hours, which represents a time zone adjustment between the current time zone and a resulting time zone. The function returns a resulting time zone code for the time zone that corresponds the time zone adjustment. For example, if a time zone code for Eastern Standard Time (EST) and an adjustment value of `-2` are input to the CURRENT TIME ZONE function, the resulting time zone code for Mountain Standard Time (MST) is returned. Another function, DIFF TIME ZONES, accepts a first time zone parameter and a second time zone parameter and calculates the difference in hours between the two time zones. This function is useful when calculating corresponding date and time values in different time zones. The time zone functions are also incorporated into various date and time arithmetic functions. For example, TZ SUBTRACT TIME FROM DATE-TIME function performs date and time subtraction in a manner similar to the SUBTRACT TIME FROM DATE-TIME function and adjusts the number of hours corresponding to the target time zone and current time zone parameters. Other date and time functions may be combined with the time zone functionality in the same manner, including adding dates and times, windowing, and format conversions. Also, as mention previously, any function using a current date and time can populate a resulting time zone output parameter to specify the proper time zone for the result. While the method disclosed herein has been described and shown with reference to particular steps performed in a particular order, it will be understood that these steps may be combined, sub-divided, or re-ordered to form an equivalent method without departing from the teachings of the present invention. Accordingly, unless specifically indicated herein, the order and grouping of the steps is not a limitation of the present invention. Moreover, while there have been described herein the principles of the present invention in conjunction with a specific COBOL data configuration, it is to be clearly understood that the foregoing description is made only by way of example and not as a limitation to the scope of the invention. Particularly, it is recognized that the teachings of the foregoing disclosure will suggest other modifications to those persons skilled in the relevant art. Such modifications may involve other features which are already known per se and which may be used instead of or in addition to features already described herein. Although claims have been formulated in this application to particular combinations of features, it should be understood that the scope of the disclosure herein also includes any novel feature or any novel combination of features disclosed either explicitly or implicitly or any generalization or modification thereof which would be apparent to persons skilled in the relevant art, whether or not such relates to the same invention as presently claimed in any claim and whether or not it mitigates any or all of the same technical problems as confronted by the present invention. The applicants hereby reserve the right to formulate new claims to such features and/or combinations of such features during the prosecution of the present application or of any further application derived therefrom.
|
Same subclass Same class Consider this |
||||||||||
