Date (L), Time (T), and Timestamp (Z)
Date (L), Time (T), and Timestamp (Z)
Both types of keyboards are in lowershift. All characters are valid for entry.
The field length (DDS positions 30 and 34) for these data types are always blank. The following rules determine the field length:
-
For the date (L) data type, the format specified on the DATFMT keyword dictates the length of the field. If you do not specify the DATFMT keyword, then the format is set to *ISO as default, which has a field length of 10. If you specify DATFMT(*JOB), the field length will always be 10, even if the Job Date Format Definition Attribute displays an 8 character date.
-
For the time (T) data type, the format specified on the TIMFMT keyword dictates the length of the field. All formats for the TIMFMT keyword, including the default of *ISO, have field lengths of 8.
-
For the timestamp (Z) data type, the field length is 26. The format of a timestamp field is
yyyy-mm-dd-hh.mm.ss.mmmmmmWhere yyyy = year, mm = month, dd = day, hh = hour, mm = minute, ss = second, and mmmmmm = microsecond.
Decimal positions (DDS positions 36 and 37) support only values of period (.). Valid field usage (DDS position 38) can be O, B, or I.
It is the responsibility of the high-level language and the application to format the date, time, and timestamp fields correctly on output. The system does not format fields on output. Date and time fields should be formatted according to the formats of the DATFMT and TIMFMT keywords and should use the separators specified for the DATSEP and TIMSEP keywords. You should use the standard timestamp format (yyy-mm-dd-hh.mm.ss.mmmmmm) for timestamp fields.
The system validates date-, time-, and timestamp-capable fields on input when the modified data tag (MDT) for a field is set to the on position. You can turn on the MDT for a field by either typing into the field or by specifying DSPATR(MDT) on the field. If the MDT for a field is turned off, the saved contents of the field return to the application. When the MDT is on for a field, date and time fields are evaluated according to the following items:
- The format specified on the DATFMT and TIMFMT keywords.
- The separators specified on the DATSEP and TIMSEP keywords.
Timestamp fields are evaluated according to the standard timestamp format (yyyy-mm-dd-hh.mm.ss.mmmmmm).
You can enter date, time, and timestamp field values with or without separators. When you enter a value without separators, leading zeros are inserted when necessary. The system includes the separators in the data that are passed back to the application. When you enter a value with separators, leading zeros are inserted up to the first separator when necessary. A value that is entered with separators cannot start with a separator. Leading and trailing blanks are ignored.
You can enter timestamp field values with or without separators. The system inserts leading or trailing zeros for timestamp fields. If you enter the field with separators, you must enter 20 digits and 6 separator characters.
You can enter the following field level keywords with these data types:
| ALIAS | ERRMSGID |
| CHANGE | FLDCSRPRG |
| CHGINPDFT | INDTXT |
| CHRID | MAPVAL |
| COLOR | NOCCSID |
| DATFMT (L) | OVRATR |
| DATSEP (L) | OVRDTA |
| DFT | PUTRETAIN |
| DFTVAL | REFFLD |
| DLTEDT | SFLCSRPRG |
| DLTCHK | TEXT |
| DSPATR | TIMFMT (T) |
| ENTFLDATR | TIMSEP (T) |
| ERRMSG |
Figure 1. Data type and keyboard shift coding
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00100A*
00200A* KEYBOARD SHIFT ATTRIBUTES
00300A CHARA 5 I 2 2
00400A CHARB 5 I 3 2CHECK(RB)
00500A CHARC 5 I 4 2CHECK(RZ)
00600A CHARD 5X I 4 30
00700A CHARE 5M I 4 40
00800A CHARF 5D I 4 50
00900A SIGN1 5 OI 5 2
01000A SIGN2 5 2B 5 30
01100A NBR1 5Y OI 6 2
01200A NBR2 5Y 2I 6 15
01300A NBR3 5Y 2B 6 30EDTCDE(L)
01400A NBR4 5N 2I 6 40
01500A NBRZ 5 H
01600A FLPT 7F 4I 7 2
01700A DATE L B 7 30DATFMT(*JUL) DATSEP('/')
01750A DATE1 L B 7 40DATFMT(*MDY) DATSEP('/')
01800A TIME T B 8 2
01900A TSTMP Z I 7 30
A
Three special characters are used in Table 1.
- _ means that you did not type in any character.
- X indicates a blank.
- } is represented internally as hex D0.
Except where indicated, you enter the data only by pressing a command function key. The fourth entry under SIGN1 is an exception. You make that entry by pressing the Field Exit key.
The following table refers to fields defined in Figure 1.
Table 1. Example data type and keyboard shift coding instructions
| Field name (keyboard shift) | As typed in by the workstation user | As passed to your program |
|---|---|---|
| CHARA (Alphanumeric shift) | 1. _ _ _ _ _ 2. A B C _ _ 3. A _ C _ _ 4. _ _ _ D E | * x x x x x (X’40’) * A B C x x * A x C x x * x x x D E |
| CHARB (Alphanumeric shift) | 1. _ _ _ _ _ 2. A B C _ _ 3. A _ C _ _ 4. _ _ _ D E | * x x x x x * x x A B C * x x A x C * x x x D E |
| CHARC (Alphanumeric shift) | 1. _ _ _ _ _ 2. A B C _ _ 3. A _ C _ _ 4. _ _ _ D E | * 0 0 0 0 0 * 0 0 A B C * 0 0 A x C * 0 0 0 D E |
| CHARD (Alphabetic only) | 1. _ _ _ _ _ 2. A B C _ _ 3. 4 _ _ _ _ 4. A B C. $ _ | * x x x x x * A B C x x * error message * error message |
| CHARE (Numeric only character) | 1. _ _ _ _ _ 2. 516.7 3. 5, 2 _ _ 4. A _ _ _ _ | * x x x x x * 516.7 * 5, 2 x x * error message |
| CHARF (Digits only) | 1. _ _ _ _ _ 2. 2 3 _ 5 _ 3. 1 2 _ _ _ 4. A _ _ _ _ | * x x x x x * 2 3 x 5 x * 1 2 x x x * error message |
| SIGN1 (Signed numeric) | 1. _ _ _ _ _ _ 2. 1 2 3 _ _ _ 3. 1 _ 3 _ _ _ 4. _ _ _ 4 5 _ (Field Exit key) 5. _ _ _ 4 5 (Field + key) 6. _ _ _ 4 5 _ (Field - key) 7. 1 2 3 4 5 _ | * 0 0 0 0 0 * 0 0 1 2 3 * 0 0 1 0 3 * 0 0 0 4 5 * 0 0 0 4 5 * 0 0 0 4 N(X’F0F0F0F4D5’) * 1 2 3 4 5 |
| SIGN2 (Signed numeric) | 1. _ _ _ _ _ _ 2. 1 2 3 4 _ _ 3. 1 2 _ _ _ _ 4. 1 2 _ _ _ _ (Field - key) | * 0 0 0 0 0 * 0 1 2 3 4 * 0 0 0 1 2 * 0 0 0 1 K (X’F0F0F0F1D2’) |
| NBR1 (Numeric only) | 1. _ _ _ _ _ 2. 0 0 0 0 5 3. 0 0 0 5 _ 4. 0 0 2 _ _ | * 0 0 0 0 0 * 0 0 0 0 5 * 0 0 0 0 5 * 0 0 0 0 2 |
| NBR2 (Numeric only) | 1. _ _ _ _ _ _ 2. 0 0 0 0 5 _ 3. 0 0 5 _ _ _ 4. 5 _ _ _ _ _ 5. 0 5 0 0 _ _ 6. 5 x 5 _ _ 7. 5 x x _ _ _ 8. 5 5 . 1 _ _ 9. 5 0 0 0 0 . _ 10. 5 0. 0 0 0 11. 5 5 – _ _ _ 12. 5 _ – – _ _ 13. 5 _ + _ – _ | * 0 0 0 0 0 * 0 0 5 0 0 * 0 0 5 0 0 * 0 0 5 0 0 * 5 0 0 0 0 * 5 0 5 0 0 * 0 0 5 0 0 * 0 5 5 1 0 * error message (use of decimal * error message not valid) * 0 5 5 0 } * 0 0 5 0 } * 0 0 5 0 } |
| NBR3 (Numeric only) | Input processing is the same as for NBR2. | |
| NBR4 (Numeric shift) | 1. _ _ _ _ _ _ 2. 5 – _ _ _ _ 3. _ 5 _ – _ _ 4. 5 _ + _ _ _ 5. 5 _ A B C _ 6. 5 _ K K _ _ 7. 5 _ K A K _ 8. 5 _ K K A _ 9. 1 0 E + 0 3 | * 0 0 0 0 0 * 0 0 5 0 } * 0 0 5 0 } * 0 0 5 0 0 * 0 0 5 0 0 * 5 0 2 0 } See note. * 5 0 2 0 } See note. * 0 0 5 0 0 See note. * 1 0 0 3 |
| NBRZ (Hidden field) | This is a hidden field and does not appear on the display. | |
| FLPT (Floating point) | 1. _ _ _ _ _ _ _ _ _ _ _ _ _ _ 2. – 9 9 . 2 _ _ _ _ _ _ _ _ _ 3. – 9 9 E 0 2 _ _ _ _ _ _ _ _ 4. + 9 9 9 . 9 9 9 9 E + 0 0 3 5. A B C _ _ _ _ _ _ _ _ _ _ _ 6. _ _9 9 0 _ e _ _ _ _ _ _ _ | * + 0 * – 9 9 . 2 * – 9 9 0 0 . * + 9 9 9 9 9 9 . 9 * error message * error message |
| DATE (Date) | 1. _ _ _ _ _ _ 2. 0 0 0 0 1 _ 3. _ _ 1 _ _ _ 4. 0 0 / 0 0 1 5. _ 0 / 0 0 1 6. / 0 0 1 _ _ 7. 0 0 — 0 0 1 8. A _ _ _ _ _ | * 4 0 / 0 0 1 * 0 0 / 0 0 1 * 0 0 / 0 0 1 * 0 0 / 0 0 1 * 0 0 / 0 0 1 * error message * error message * error message |
| DATE1 (Date) | 1. _ _ _ _ _ _ _ _ 2. 0 6 0 2 9 7 _ _ 3. 6 0 2 9 7 _ _ _ 4. 0 6 / 0 2 / 9 7 5. _ 6 / 2 / 9 7 _ 6. 0 6 — 0 2 — 9 7 7. 6 / 9 7 _ _ _ _ 8. 6 / / 9 7 _ _ _ 9. 1 3 / 2 / 9 7 _ 10. 6 / 3 1 / 9 7 _ 11. A / 2 / 9 7 _ _ | * 0 1 / 0 1 / 4 0 * 0 6 / 0 2 / 9 7 * 0 6 / 0 2 / 9 7 * 0 6 / 0 2 / 9 7 * 0 6 / 0 2 / 9 7 * error message * error message * error message * error message * error message * error message |
| TIME (Time) | 1. _ _ _ _ _ _ _ _ 2. 1 2 3 4 5 6 _ _ 3. _ _ 1 2 3 4 5 6 4. 1 2 _ _ _ _ _ _ 5. 1 2 3 4 _ _ _ _ 6. 1 2 . 3 4 . 5 6 7. 1 . 2 . 3 _ _ _ 8. 0 1 : 0 0 : 0 0 9. 1 2 3 _ _ _ _ _ 10. 1 2 3 4 5 _ _ _ 11. 1 . 0 0 0 0 _ _ | * 0 0 . 0 0 . 0 0 * 1 2 . 3 4 . 5 6 * 1 2 . 3 4 . 5 6 * 1 2 . 0 0 . 0 0 * 1 2 . 3 4 . 0 0 * 1 2 . 3 4 . 5 6 * 0 1 . 0 2 . 0 3 * error message * error message * error message * error message |
| TSTMP (Timestamp) | 1. 2000–01–01–01.00.00.000000 2. 20000101010000000000______ 3. 2000/01/01/01.00.00.000000 4. 0000–00–00–00.00.00.000000 | * 2000–01–01–01.00.00.000000 * 2000–01–01–01.00.00.000000 * error message * error message |
Note: The internal representation of K is hex D2. All nonnumeric characters (including those with hex D in the zone portion) are deleted with no place value. For example, 5_KAK_ becomes 5020}.