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.

The referenced field can be previously defined in either the display file you are defining or a previously created database file (the database file to be referred to is specified with the REF or REFFLD keyword). The field attributes referred to are the length, data type, and decimal positions of the field, as well as the following keywords:
  • 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.

You do not need to copy all attributes from the previously defined field to the field you are defining. To override specific attributes of the referenced field, specify those attributes for the field you are defining as follows:
  • 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:

Note: After the display file is created, you can delete or change the referenced file without affecting the field descriptions in the display file. Delete and create the display file again to incorporate changes made in the referenced file.