Principles and objectives of these extensions
To
gain the most benefit from the millennium language extensions, you need to
understand the reasons for their introduction into the COBOL language.
The millennium language extensions focus on a few key principles:
- Programs to be recompiled with date semantics are fully tested and
valuable assets of the enterprise. Their only relevant limitation is that
two-digit years in the programs are restricted to the range 1900-1999.
- No special processing is done for the nonyear part of dates. That is why
the nonyear part of the supported date formats is denoted by Xs. To
do otherwise might change the meaning of existing programs. The only
date-sensitive semantics that are provided involve automatically expanding
(and contracting) the two-digit year part of dates with respect to the
century window for the program.
- Dates with four-digit year parts are generally of interest only when used
in combination with windowed dates. Otherwise there is little difference
between four-digit year dates and nondates.
Based
on these principles, the millennium language extensions are designed to meet
several objectives. You should evaluate the objectives that you need to meet in
order to resolve your date-processing problems, and compare them with the
objectives of the millennium language extensions, to determine how your
application can benefit from them. You should not consider using the extensions
in new applications or in enhancements to existing applications, unless the
applications are using old data that cannot be expanded until later.
The objectives of the millennium language extensions are as follows:
- Extend the useful life of your application programs as they are currently
specified.
- Keep source changes to a minimum, preferably limited to augmenting the
declarations of date fields in the DATA DIVISION. To implement the
century window solution, you should not need to change the program logic in
the PROCEDURE DIVISION.
- Preserve the existing semantics of the programs when adding date fields.
For example, when a date is expressed as a literal, as in the following
statement, the literal is considered to be compatible (windowed or expanded)
with the date field to which it is compared:
If Expiry-Date Greater Than 980101 . . .
Because the existing program assumes that two-digit-year dates expressed
as literals are in the range 1900-1999, the extensions do not change this
assumption.
- The windowing feature is not intended for long-term use. It can extend the
useful life of applications as a start toward a long-term solution that can
be implemented later.
- The expanded date field feature is intended for long-term use, as an aid
for expanding date fields in files and databases.
The extensions do not provide fully specified or complete date-oriented data
types, with semantics that recognize, for example, the month and day parts of
Gregorian dates. They do, however, provide special semantics for the year part
of dates.
|