Handling DATE, TIME, and TIMESTAMP information

You can also use the edit code exit to format date, time, and timestamp values.

If your installation supports date/time data types, you can format columns with data types of DATE, TIME, and TIMESTAMP. This enables your users to use local date/time exit routines. For more information about these data types, see the Using QMF manual. You need to remember that these are DB2, not QMF exits. For details about how these exits are created refer to the appropriate DB2 System Administration manual.

Your edit routine can format data from these columns, just as it can format data from columns of the other data types. The one difference is that the value to be formatted, which appears in the control block field ECSINPT, is always passed as a character string, whether the code to be processed is a U code or a V code. The format of the string is described in Table 68.

Table 68. Formatting DATE, TIME, and TIMESTAMP data
Data type Form of the string
DATE data yyyy-mm-dd where:
yyyy
Specifies the year. It is always a four-digit number.
mm
Specifies the month ( 01 for January, ... 12 for December). It is always a two-digit number that can contain a leading zero.
dd
Specifies the day of the month. It is always a two-digit number that can contain a leading zero.
The dashes (-) represent true dashes.

For example, 1990-12-12 is the date December 12, 1990.

TIME data hh.mm.ss where:
hh
Specifies the hour (based on a 24-hour clock, from 00 to 23). It is always a two-digit number that can contain a leading zero.
mm
Specifies the minute. It is always a two-digit number that can contain a leading zero.
ss
Specifies the second. It is always a two-digit number that can contain a leading zero.
The periods represent true periods.

For example, 13.08.36 is 1:08 P.M. and 36 seconds in the notation commonly used in the United States.

TIMESTAMP data yyyy-mm-dd-hh.mm.ss.nnnnnn where:
yyyy-mm-dd
Specifies the date in the same way it does for DATE data.
hh.mm.ss
Specifies the time of day in the same way it does for TIME data.
nnnnnn
Specifies a six-digit number that extends the count of seconds (ss) down to the nearest microsecond.
For example, 1990-12-12-13.08.36.123456 is 1:08 P.M. and 36.123456 seconds on December 12, 1990, in the notation commonly used in the United States.

For the data types available, see the ECSINTYP field in Table 69.

[ Previous Page | Next Page | Contents | Index ]