Previous Topic Next topic Print topic


DATE

Data Format

If a COBOL output host variable is defined for an SQL DATE value, the date is specified in the format:
yyyy-mm-dd
For example:
1994-05-24

Host Variable Formats

OpenESQL and DB2 ECM
01 date1         PIC X(10).
OpenESQL
01 date2         SQL TYPE IS DATE.
01 date3         SQL TYPE IS DATE-RECORD.
  • When using the date1 format:
    • OpenESQL requires that you compile applications with the DETECTDATE SQL directive.
    • Move date specifications into the host variable in the form:
      {d 'yyyy-mm-dd'}
  • The date2 format uses the DATE SQL TYPE.
  • The date3 format uses the DATE-RECORD SQL TYPE.
OpenESQL .NET Managed Runtime
In addition to the definitions valid for all databases and those valid for OpenESQL, the following definition is also valid for the OpenESQL .NET Managed Runtime:
01 date4         type System.DateTime.
Previous Topic Next topic Print topic