X 6.1.6.4.1 Date Fields
X Date fields can be alphanumeric, external decimal, or internal decimal;
X the existing rules for the validity and mode (numeric or nonnumeric) of
X comparing such items still apply. For example, an alphanumeric date field
X cannot be compared with an internal decimal date field. In addition to
X these rules, two date fields can be compared only if they are compatible;
X they must have the same date format except for the year part, which may be
X windowed or expanded.
| For year-last date fields, the only comparisons that are supported are IS
| EQUAL TO and IS NOT EQUAL TO between two year-last date fields with
| identical date formats, or between a year-last date field and a non-date.
| Table 22shows supported comparisons for non-year-last date fields. This
X table uses the following terms to describe how the comparisons are
X performed:
X Non-windowed
-
X The comparison is performed with no windowing, as if the
X operands were both non-dates.
X Windowed
-
X The comparison is performed as if:
- X Any windowed date field in the relation were expanded
X according to the century window specified by the YEARWINDOW
X compiler option, as described under "Semantics of Windowed
X Date Fields" in topic 5.3.6.1.
| >_Host_> This expansion is sensitive to trigger values in
| the date field comparand if the DATEPROC(TRIG) compiler
| option is in effect. <_Host_<
- X Any repetitive alphanumeric figurative constant were
X expanded to the size of the windowed date field with which
X it is compared, giving an alphanumeric non-date comparand.
X Repetitive alphanumeric figurative constants include ZERO
X (in an alphanumeric context), SPACE, LOW-VALUE, HIGH-VALUE,
X QUOTE and ALL literal.
- X Any non-date operands were treated as if they had the same
X date format as the date field, but with a base year of 1900.
| >_Host_> If the DATEPROC(NOTRIG) compiler option is in
| effect, the comparison is performed as if the non-date
| operand were expanded by assuming 19 for the century part of
| the expanded year.
| If the DATEPROC(TRIG) compiler option is in effect, the
| comparison is sensitive to date trigger values in the
| non-date operand. For alphanumeric operands, these trigger
| values are LOW-VALUE, HIGH-VALUE, and SPACE. For
| alphanumeric and numeric operands compared with windowed
| date fields with at least one X in the DATE FORMAT clause
| (that is, windowed date fields other than just a windowed
| year), values of all zeros or all nines are also treated as
| triggers. If a non-date operand contains a trigger value,
| the comparison proceeds as if the non-date operand were
| expanded by copying the trigger value to the assumed century
| part of the expanded year. If the non-date operand does not
| contain a trigger value, the century part of the expanded
| year is assumed to be 19. <_Host_<
X The comparison is then performed according to normal COBOL
X rules. Nonnumeric comparisons are not changed to numeric
X comparisons by the prefixing of the century value.
|
|
|
|
X Table 22. Comparisons with Date Fields |
X X X First Operand |
X Second Operand |
X X Non-date |
X Windowed date X field |
X Expanded date X field |
X Non-date |
X Non-windowed |
X Windowed(1) |
X Non-windowed |
X Windowed date X field |
X Windowed(1) X |
X Windowed X |
X Windowed X |
X Expanded date X field |
X Non-windowed X |
X Windowed X |
X Non-windowed X |
X Note: X 1. When compared with windowed date fields, non-dates are assumed to X contain a windowed year relative to 1900. For details, see items X 3 and 4 under the definition of "Windowed" comparison. |
X Relation conditions can contain arithmetic expressions. For information
X about the treatment of date fields in arithmetic expressions, see
X "Arithmetic with Date Fields" in topic 6.1.5.2.
© Copyright IBM Corp. 1991, 1998
IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.
Return to library:
z/OS |
z/OS.e |
TPF |
z/VSE |
z/VM |
IBM Hardware |
IBM System z Redbooks
Glossary:
IBM terminology
Publications:
How to order publications
Readers:
Download IBM Library Reader |
Download IBM Softcopy Reader |
Download Adobe® Acrobat® Reader®
Library management:
Download IBM Softcopy Librarian
Contacts:
Contact z/OS
Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks
of Adobe Systems incorporated.