Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp

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:

  1. 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_<
    
    
  2. 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.
    
    
  3. 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.


RevisionX  Table 22. Comparisons with Date Fields                                 
RevisionX                   
                  
RevisionX                   
RevisionX  First Operand    
RevisionX                     Second Operand                   
RevisionX               
RevisionX  Non-date     
RevisionX  Windowed date     
RevisionX  field             
RevisionX  Expanded date    
RevisionX  field            
RevisionX  Non-date          RevisionX  Non-windowed  RevisionX  Windowed(1)        RevisionX  Non-windowed     
RevisionX  Windowed date    
RevisionX  field            
RevisionX  Windowed(1)  
RevisionX               
RevisionX  Windowed          
RevisionX                    
RevisionX  Windowed         
RevisionX                   
RevisionX  Expanded date    
RevisionX  field            
RevisionX  Non-windowed 
RevisionX               
RevisionX  Windowed          
RevisionX                    
RevisionX  Non-windowed     
RevisionX                   
RevisionX  Note:                                                                  
                                                                        
RevisionX  1.  When compared with windowed date fields, non-dates are assumed to  
RevisionX      contain a windowed year relative to 1900.  For details, see items  
RevisionX      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.

Previous Topic Next Topic © 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.