DATE

Specifies the explicit date format to use when date values are returned from PostgreSQL date columns in character output host variables.

When used in addition to DETECTDATE, specifies the explicit data format to recognize in character input host variables.

Restriction: This topic documents DATE as used as an HCOPG SQL compiler directive option and therefore assumes that you have set DIALECT=MAINFRAME. For information on using DATE as a generic SQL compiler directive option, see DATE under SQL Compiler Directive Options. For information on the DIALECT HCOPG SQL compiler directive option, see DIALECT.

Syntax:

DATE={ODBC | ISO | USA | EUR | JIS}

Parameters:

ODBC
yyyy-mm-dd (PostgreSQL default format)
ISO
yyyy-mm-dd (mainframe default format)
USA
mm/dd/yyyy
EUR
dd.mm.yyyy
JIS
yyyy-mm-dd

Properties:

Default: ISO (mainframe default format)

Dependencies:

To use DATE, you must also set DIALECT=MAINFRAME.

For input host parameters, requires that the DETECTDATE HCOPG SQL compiler directive option also be set.

Scope:

Used at compile time: Yes
Behavior at run time: Source file

See Scope - HCOPG SQL Compiler Directive Options for more information.

Comments:

DATE changes the display format of output host variables as specified.

Note: If you do not specify an alternative format using DATE, HCOPG returns your PostgreSQL date columns using mainframe ISO format in your output character host variables by default, as specified in the Properties section of this topic.

When you specify both DATE and DETECTDATE, HCOPG uses DATE to recognize date values in your input host variables. See DETECTDATE for more information.