This topic provides information to help you decide if you want to specify the REF (reference) or REFFLD (referenced field) keyword or both. It also tells you how to specify parameter values for each REF or REFFLD keyword you specify.
You must specify R in position 29 for each field that refers to another field that was previously defined.
Answer the following questions to determine which keyword to use:
If all or most of the fields you refer to are defined REF at the file level.
or
The database file name specified on a REFFLD keyword overrides the database file name specified on the REF keyword.
If you do not specify *SRC or a database file name on the REFFLD keyword, the default is *SRC if the REF keyword is not specified. If the REF keyword is specified, the default is the database file name specified on the REF keyword.
If the job that will create the file you are defining (perhaps your interactive job) has a library list, and the database file you specified is on the library list, enter only the file name (FILE1). Otherwise, specify the file name qualified by the library name (LIB1/FILE1).
If the file you reference has only one record format, do not specify a record format name.
If it has more than one record format, specify a record format name.
The following example illustrates reference function specifications. It is not a valid example of any file except an ICF file. Display and printer files must have a location specified for each field. Physical files can have only one record format. The REF and REFFLD keywords are not allowed in logical files.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 00010A REF(FILE1) (1) 00020A R RECORD1 00030A FIELD1 R (1) 00040A FIELD2 R (1) 00050A FIELD3 R REFFLD(FLD3) (2) 00060A FIELD4 R REFFLD(FLD4 FILE2) (3) 00070A FIELD5 R REFFLD(FLD5 LIB1/FILE3) (4) 00080A FIELD6 R REFFLD(RECORDB/FLD6 LIB1/FILE4) (5) 00090A FIELD7 R REFFLD(FIELD6 *SRC) (6) 00100A FIELD8 R REFFLD(FLD6) (7) 00110A R RECORD2 00120A FIELD1 20 (8) 00130A 00140A R RECORD3 00150A FIELD1 R REFFLD(RECORD2/FIELD1 *SRC) (9) 00160A 00170A R RECORD4 00180A FIELD1 R REFFLD(FIELD1 *SRC) (10) A