DDS for display files

Data type/keyboard shift for display files (position 35)

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.

Valid entries for display files

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
Note:
The data types J (only), E (either), O (open), and G (graphic) support DDS display files that use DBCS. The G (graphic) data type also supports DDS display files that use UTF-16 and UCS-2.

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.

Default (Blank)

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.

Alphabetic Only (X)

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.

Alphanumeric Shift (A)

Both types of keyboards are in lowershift. All characters are valid for entry.

Numeric Shift (N)

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.

Note:
Input numeric shift fields with specified decimal positions (in positions 36 and 37) are processed by data management as numeric-only fields, except that editing is not supported. For more information, see the keyboard attribute section, "Numeric Only (Y)"

Signed Numeric (S)

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.

Numeric Only (Y)

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:

Note:
The OS/400 program examines each character of a numeric-only field to remove the nonnumeric characters plus sign (+), minus sign (-), comma (,), and decimal point(.) and nonsignificant digits, and to convert embedded blanks to zeros. This examination and removal can delay response time if a significant number of fields must be processed on an input operation.

Katakana (W)

This field attribute designates the Japanese Katakana keyboard shift. All characters are valid for entry.

Inhibit Keyboard Entry (I)

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.

Digits Only (D)

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.

Numeric Only Character (M)

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).

Floating Point (F)

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.



An illustration that depicts the five parts of a floating-point value. These parts are described in the text following this graphic.

The parts in the illustration are as follows:

Notes:

  1. When a floating-point value displays, embedded blanks are removed. On input, you can type blanks before or after a floating-point value. Within a floating-point value, blanks are allowed between the significand and the exponent character.

  2. If you do not type a value in a displayed floating-point field, a positive zero is assumed.

  3. A value of negative zero is valid in a floating-point field. Only the first zero to the left of the decimal point displays. A minus sign displays to the left of the first zero.

  4. A value of positive zero is valid in a floating-point field. The significand sign (+) does not display. Only the first zero to the left of the decimal point displays.

  5. You can type a fixed-point value in a floating-point field.

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.

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:

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)
  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}.

Keyboard types

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.

Typewriter-like 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.

Note:
None of the keyboard shift attributes causes an automatic uppershift for the typewriter-like keyboard.

The following illustration shows the typewriter-like keyboard.



An illustration of a typewriter-like keyboard. This keyboard is described in the text.

Data-entry 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.



An illustration of the data-entry keyboard. This keyboard is described in the text.

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.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]