Use TIMESTAMP-RECORD to generate a group-level record for the timestamp containing individual records for each element of the timestamp as follows:
To insert data, you must pass valid data in the generated field names.
If you pass... | SQL Server returns... |
---|---|
01/01/98 23:59.59.999 | 1998-01-02 00:00:00.000 |
01/01/98 23:59.59.995 | 1998-01-01 23:59:59.997 |
01/01/98 23:59.59.996 | 1998-01-01 23:59:59.997 |
01/01/98 23:59.59.997 | 1998-01-01 23:59:59.997 |
01/01/98 23:59.59.998 | 1998-01-01 23:59:59.997 |
01/01/98 23:59.59.992 | 1998-01-01 23:59:59.993 |
01/01/98 23:59.59.993 | 1998-01-01 23:59:59.993 |
01/01/98 23:59.59.994 | 1998-01-01 23:59:59.993 |
01/01/98 23:59.59.990 | 1998-01-01 23:59:59.990 |
01/01/98 23:59.59.991 | 1998-01-01 23:59:59.990 |
01 hv-name SQL TYPE IS TIMESTAMP-RECORD.
generates
01 hv-name. 03 hv-name-year PIC S9(4) COMP-5. 03 hv-name-month PIC 9(4) COMP-5. 03 hv-name-day PIC 9(4) COMP-5. 03 hv-name-hour PIC 9(4) COMP-5. 03 hv-name-min PIC 9(4) COMP-5. 03 hv-name-sec PIC 9(4) COMP-5. 03 hv-name-frac PIC 9(9) COMP-5.