The entry you make in position 35 is the data type/keyboard shift attribute for display files. This entry does not determine the data type of the field used in your program. The entry in positions 36 and 37 (decimal positions) determines the data type of the field. See Decimal positions for display files (positions 36 and 37).
The keyboard shift attribute automatically shifts 5250 workstations with data-entry keyboards and can, for all keyboards, limit what the workstation user can type into a field. However, the keyboard shift attribute does not shift 5250 workstations with the typewriter-like keyboard. Nor does the keyboard shift attribute restrict in any way what your program can write to a field. Your program can write alphabetic characters to a numeric field and, in most cases, read that field and receive those characters. Any restrictions are enforced solely by the programming language used for your program.
Following are valid entries for display files:
Entry Keyboard Shifts | Meaning | Data Type Permitted |
---|---|---|
Blank | Default |
|
X | Alphabetic only | Character |
A | Alphanumeric shift | Character |
N | Numeric shift | Character or numeric |
S | Signed numeric | Numeric |
Y | Numeric only | Numeric |
W | Katakana (for Japan only) | Character |
I | Inhibit keyboard entry | Character or numeric |
D | Digits only | Character or numeric |
M | Numeric only character | Character |
|
|
|
Data Type (see note below) |
|
|
F | Floating point | Numeric |
L | Date |
|
T | Time |
|
Z | Timestamp |
|
Figure 1 and Figure 6 show you how to specify the keyboard shift attribute.
The keyboard shift attributes are defined in detail in the following sections.
If you leave position 35 blank, the entry in positions 36 and 37 (decimal positions) determines the data type of the field as follows:
If you specify the REFSHIFT keyword for a referenced field, the specified value is used. Otherwise, a data type of packed or binary is converted to zoned decimal in the display file. Conversion to or from packed or binary can occur within your program.
Both types of keyboards are in lowershift. Only the characters A through Z, comma (,), period (.), dash (-), and space ( ) can be typed in. When you type lowercase characters a through z, uppercase characters are sent to the program. See CHECK (Check) keyword for display files for an explanation of how to permit typing in lowercase characters for the typewriter-like keyboard on the 5250 workstation.
Both types of keyboards are in lowershift. All characters are valid for entry.
Each type of keyboard is shifted to allow numeric entry: uppershift for the data-entry keyboard and lowershift for the typewriter-like keyboard. All characters are valid for entry.
The display length for a numeric shift field is one more than the length coded in positions 30 through 34 when the following conditions occur:
The extra position in the display length is for the decimal point.
Each type of keyboard is shifted to allow numeric entry: uppershift for the data-entry keyboard and lowershift for the typewriter-like keyboard. You can only type the numbers 0 through 9 into the field (no blanks, no plus sign, no minus sign). To leave the field, press the Field Exit key, the Field+ key, the Field- key, or a cursor movement key. If you do not type any data into the field, you can press the Enter key.
You should consider the following differences when you choose between signed numeric (S) and numeric only (Y):
For input-capable fields only, the display length for the field is one more than the length specified in positions 30 through 34. The farthest right position on the display is reserved for a minus sign.
The following considerations apply when the OS/400 program passes the contents of a signed numeric field to your program:
When an input-capable signed numeric field displays and you do not specify CHECK(RZ), the OS/400 program performs zero suppression by default (the EDTCDE and EDTWRD keywords are not valid for signed numeric fields).
Negative numbers are handled as follows:
For examples of signed numeric fields, and sample data typed into them, see Figure 6.
Each keyboard is shifted to allow numeric entry: uppershift for the data-entry keyboard and lowershift for the typewriter-like keyboard. You can only type the numbers 0 through 9, plus (+), minus (-), period (.), comma (,), and space ( ) into the field. You can press any key to leave the field.
The display length for a numeric-only field is one more than the program length when both of the following conditions occur (the program length is specified in positions 30 through 34):
The extra position in the display length is for the decimal point.
When the OS/400 program passes the contents of the field to your program, the following considerations apply:
When the OS/400 program displays a numeric-only field, the EDTCDE or the EDTWRD keyword, if specified, applies. You can specify EDTCDE and EDTWRD only for numeric-only fields. The display length equals the program length plus the editing characters from the specified edit code or edit word.
Negative numbers are handled as follows:
If you do not specify CHECK(RZ) or CHECK(RB), a brace (}) is displayed in the farthest right position. This causes an error message to appear at the workstation if you specify decimal positions other than zero in positions 36 and 37. If you specify CHECK(RZ) or CHECK(RB), the digits typed in are right-justified. No minus sign appears in either case.
If you specify an EDTCDE keyword that displays a minus sign and you do not specify CHECK(RZ) or CHECK(RB), a brace (}) is displayed in the farthest right position. This does not cause an error message to appear at the workstation. A minus sign appears in the farthest right position on output.
If you specify an EDTCDE keyword that displays a minus sign and you also specify CHECK(RZ) or CHECK(RB), the farthest right significant digit is displayed as hex Dn (negative). A minus sign appears on the output.
When a negative number passes to your program, the OS/400 program converts the farthest right significant digit from hex Fn (positive) to hex Dn (negative), where n is the significant digit.
This field attribute designates the Japanese Katakana keyboard shift. All characters are valid for entry.
A field with this keyboard shift attribute does not accept data typed in from the keyboard, and an error is issued if you press any keys. You can press the field advance key to position the cursor at the start of the field. This field can be used to allow input from feature devices such as a light pen. The Field+, Field Exit, and Dup keys are valid for a field with this attribute, and function the same as if pressed in any input field for which the Display Attribute Protect (DSPATR(PR)) keyword is not in effect.
The display length for an inhibit keyboard entry field is one position greater than the length coded in positions 30 through 34 when the following conditions occur:
The extra position in the display length is for the decimal point.
Each type of keyboard is shifted to allow numeric entry: uppershift for the data-entry keyboard and lowershift for the typewriter-like keyboard. The numbers-only keyboard shift defines a character or numeric field that allows you to key only the digits 0 through 9 into the field. You cannot key special characters or blanks.
The numbers-only keyboard shift is supported only on devices that are configured on the 6040 or 6041 local controller or the 5294 or 5394 Control Unit. When a digits-only field is sent to a device that is not configured on a valid controller type, the field is processed as alphanumeric (keyboard shift A). Since you can type any alphanumeric character into the field, a decimal data error can result in the application program.
The Field Exit, Field+ Exit, and Dup keys are allowed. The Field+ Exit is processed as an unsigned Field Exit. The Field- Exit key is not allowed.
Blank and zero are the only supported values for decimal positions (DDS positions 36 and 37). If positions 36 and 37 are blank, the field is considered a character field. If you specify zero, the field is considered numeric.
You can only enter a positive integer value into a D field.
The display length of a digits-only field is always the field length as specified in positions 30 through 34.
Zero suppression is not supported for digits-only fields. EDTCDE and EDTWRD keywords are not valid, and the OS/400 program does not perform zero suppression by default, as it does for signed-numeric fields.
You cannot enter blanks into the field. However, you can move the cursor out of the field after entering part of it. If you move the cursor after entering part of the field, when the OS/400 program passes the contents of the field to a program, the following considerations apply:
In a database file, you can specify the D keyboard shift on the REFSHIFT keyword if the field data type is numeric or character (S, B, P, or A). For a numeric field, the number of decimal positions must be zero.
Each type of keyboard is shifted to allow numeric entry: uppershift for the data-entry keyboard and lowershift for the typewriter-like keyboard. The M keyboard shift defines a character field that allows you to type only the digits 0 through 9, plus (+), minus (-), comma (,), period (.), and blank into the field.
The Field Exit, Field+ Exit, Field- Exit, and Dup keys are allowed. The Field+ Exit is processed as an unsigned Field Exit. The Field- Exit is processed as follows:
The display length for an M field is the length coded in positions 30 through 34. You must include any additional positions needed for a sign character or decimal point in the field length.
The field displays as a blank-filled field unless you specify a CHECK(RZ) or CHECK(RB) keyword, in which case the field displays as right-justified, zero, or blank filled respectively.
When the OS/400 program passes the contents of the field to a program, the following considerations apply:
In a database file, you can specify the M keyboard shift on the REFSHIFT keyword if the field data type is character (A).
Each type of keyboard is shifted to allow numeric entry: uppershift for the data-entry keyboard and lowershift for the typewriter-like keyboard. You can type any combination of characters in a floating-point field (but only the digits 0 through 9, sign characters (+ or -), E or e, decimal point (.), and comma (,) are valid). An error message is issued if you type any other character in a floating-point field.
A floating-point value consists of five parts:
The following illustration shows the five parts of a floating-point value.
The parts in the illustration are as follows:
Notes:
The display length for a floating-point field is 7 positions greater than the length specified in positions 30 through 34. The 7 extra positions are for the significand sign, the decimal point or comma, the exponent character, the exponent sign, and the 3 exponent digits. Figure 6 and Table 2 show how the data you type is passed to your program.
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:
yyyy-mm-dd-hh.mm.ss.mmmmmm
Where 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) may 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 DATFMT and TIMFMT keywords formats and 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 postion. 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:
Timestamp fields are evaluated according to the standard timestamp format (yyyy-mm-dd-hh.mm.ss.mmmmmm).
You may enter date, time, and timestamp field values with or without separators. When you enter a value without separators, leading zeros are inserted when neccessary. 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 may not start with a separator. Leading and trailing blanks are ignored.
You may 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 may 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 | SFLCRSPRG |
DLTCHK | TEXT |
DSPATR | TIMFMT (T) |
ENTFLDATR | TIMSEP (T) |
ERRMSG |
|
Figure 6. Data Type and Keyboard Shift Coding Example
|...+....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 2.
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 6.
Table 2. 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) |
|
|
CHARB (Alphanumeric Shift) |
|
|
CHARC (Alphanumeric Shift) |
|
|
CHARD (Alphabetic Only) |
|
|
CHARE (Numeric Only Character) |
|
|
CHARF (Digits Only) |
|
|
SIGN1 (Signed Numeric) |
|
|
SIGN2 (Signed Numeric) |
|
|
NBR1 (Numeric Only) |
|
|
NBR2 (Numeric Only) |
|
|
NBR3 (Numeric Only) | Input processing is the same as for NBR2. |
|
NBR4 (Numeric Shift) |
|
|
NBRZ (Hidden Field) | This is a hidden field and does not appear on the display. |
|
FLPT (Floating point) |
|
|
DATE (Date) |
|
|
DATE1 (Date) |
|
|
TIME (Time) |
|
|
TSTMP (Timestamp) |
|
|
|
There are two keyboards on iSeries server, a typewriter-like keyboard and a data-entry keyboard. Display stations can have either the typewriter-like or the data-entry keyboard.
The typewriter-like keyboard functions in either uppershift or lowershift. Type the upper symbol (for the keys with two symbols) when in uppershift. Type the lower symbol (for the keys with two symbols) when the keyboard is in lowershift. Type uppercase characters for alphabetic keys (which have only one symbol) when the keyboard is in uppershift. Type uppercase alphabetic characters when the keyboard is in lowershift, unless the Check Lowercase (CHECK(LC)) keyword is specified. If the CHECK(LC) keyword is specified, and you place (or leave) the keyboard in lowershift, you can type lowercase a through z characters.
The following illustration shows the typewriter-like keyboard.
The data-entry keyboard functions in either numeric shift (upper) or alphabetic shift (lower). The upper symbol (for the keys with two symbols) is typed when the keyboard is in uppershift. On this keyboard, the numbers 0 through 9 are the upper symbols on alphabetic keys. The lower symbol (for the keys with two symbols) is typed when the keyboard is in lowershift. The alphabetic characters A through Z are the lower symbols and are always in uppercase. The data-entry keyboard does not support lowercase characters a through z, even if you specify CHECK(LC) keyword.
The following illustrations shows the data-entry keyboard.
Note that you type the numbers 0 through 9 by using the lowershift on the typewriter-like keyboard and by using the uppershift (numeric) on the data-entry keyboard. Therefore, when a field has one of the numeric keyboard shift attributes (numeric shift or numeric only), the typewriter-like keyboard is in lowershift and the data-entry keyboard is in uppershift. In both cases, you can type numeric characters without pressing a shift key.
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.