REFSHIFT (Reference Shift) keyword for physical and logical files

You can use this field-level keyword to specify a keyboard shift for a field when the field is referred to in a display file or data file utility (DFU) operation.

The format of the keyword is:
REFSHIFT(keyboard-shift)

When defining an input-capable field in a display file, refer to the field that you are defining by specifying the letter R in position 29 and the REF or REFFLD keyword. At display file creation, the operating system copies the REFSHIFT keyword and other field attributes from the field in the logical file into the field in the display file. You can override the editing specified in the display or printer file by specifying new editing keywords. Specifying the DLTEDT keyword deletes all editing for the field.

The keyboard shift in the display file (position 35) becomes the parameter value specified on this keyword instead of the data type specified in the database file. When you refer to a field with the REFSHIFT keyword from a physical or logical file, the REFSHIFT keyword is copied into the new field. However, if the field attributes (such as data type) specified for the new field are not compatible with the keyboard shift specified on the REFSHIFT keyword, the keyword is ignored.

This keyword is valid for fields with data types A, S, B, or P. Choose any keyboard shift that is compatible with the data type as a parameter value. The following parameters apply to the data types:
  • Character field (A): REFSHIFT(A | X | W | N | I | D | M)
  • Numeric fields (S, B, P): REFSHIFT(S | Y | N | I | D)

Examples

The following example shows how to specify the REFSHIFT keyword for a physical file.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A          R RECORD
00020A            FIELDA         5          REFSHIFT(X)
00030A            FIELDN         4P         REFSHIFT(N)
     A

Fields FIELDA and FIELDN in the file (FILE1) have the REFSHIFT keyword specified as shown. The REFSHIFT keyword is used when the fields are referred to from a display file.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A                                      REF(FILE1)
00020A          R RECORD
00030A            FIELDA    R           1  2
     A            FIELDN    R           2  2
     A
The display file references FILE1 (REF keyword). Fields FIELDA and FIELDN in this display file reference fields FIELDA and FIELDN in FILE1. When the REFSHIFT keyword is specified for the fields in FILE1, the keyboard shift specified with the REFSHIFT keyword is used in the display file, and the fields have the following attributes:
  • FIELDA has keyboard shift X in position 35.
  • FIELDN has keyboard shift N in position 35.