Reference for display files (position 29)
You can specify R in this position to use the reference function of the IBM® i operating system. This function copies the attributes of a previously defined, named field (called the referenced field) to the field you are defining.
- ALIAS (alternative name)
- CCSID (Coded Character Set Identifier)
- FLTPCN (floating-point precision)
- TEXT
- DATFMT
- DATSEP
- TIMFMT
- TIMSEP
- Editing and validity checking keywords
If you do not specify R, you cannot use the reference function for this field and you must specify field attributes for this field.
Position 29 must be blank at the file, record, and help levels.
If the name of the referenced field is the same as the field you are defining, you need only specify R in position 29 (in addition to specifying the name of the field you are defining in positions 19 through 28). If the name of the field you are defining is different from the name of the referenced field you must specify the name of the referenced field with the REFFLD (Referenced Field) keyword.
You can specify the name of the file defining the referenced field as a parameter value with the REF (Reference) or the REFFLD keyword.
- To override the EDTCDE (Edit Code) or EDTWRD (Edit Word) keywords, specify EDTCDE or EDTWRD for the field you are defining. You can delete these keywords by specifying the DLTEDT (Delete Edit) keyword for the field you are defining.
- To override the CHECK (Check), COMP (Comparison), RANGE (Range), and VALUES (Values) validity checking keywords and the CHKMSGID (Check Message Identifier) keyword, specify any validity checking keyword for the field you are defining. You can delete these keywords by specifying the DLTCHK (Delete Check) keyword for the field you are defining.
When you override some specifications, others are also affected:
- If you specify keyboard shift attribute, field length, or decimal positions for the field you are defining, neither editing nor validity checking keywords are copied from the referenced field.
- If you override the previously defined data type to character (by specifying M, A, X, or W in position 35), decimal positions are not copied. However, if you specify N, D, or I in position 35 and leave blanks in positions 36 and 37 (decimal positions), the field you define has the decimal positions of the referenced field. For D, the decimal positions must be zero.
- Packed decimal and binary fields are not supported for display files.
Therefore, when you refer to fields of these types, the data type assigned
is zoned decimal with a keyboard shift as follows:
- If editing is in effect for the field you are defining, the keyboard shift is numeric only (Y in position 35).
- If no editing is in effect for the field you are defining, the keyboard shift is signed numeric (S in position 35).
- When the referenced field contains the REFSHIFT (Reference Shift) keyword, the value specified for REFSHIFT is used as the display file keyboard shift. However, if the data type specified for the new field is not compatible with the keyboard shift specified on the REFSHIFT keyword, the keyword is not copied to the new field.