When to specify REF and REFFLD keywords for DDS files

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:

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.

Figure 1. Sample Reference Function Specifications
|...+....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
Note: For line 00010, you can also specify library name and record format name. See the REF keyword example.
Legend:
1
FIELD1 and FIELD2 have the same attributes as FIELD1 and FIELD2 in FILE1.
2
FIELD3 has the same attributes as FLD3 in FILE1.
3
FIELD4 has the same attributes as FLD4 in FILE2.
4
FIELD5 has the same attributes as FLD5 in FILE3 in LIB1.
5
FIELD6 has the same attributes as FLD6 in record format RECORDB in FILE4 in LIB1.
6
FIELD7 has the same attributes as FIELD6 (on the preceding line in this file).
7
FIELD8 has the same attributes as FLD6 in FILE1.
8
FIELD1 in RECORD2 has unique field attributes. (It does not use the reference function; notice that R is not specified in position 29.)
9
FIELD1 in RECORD3 has the same attributes as FIELD1 in RECORD2.
10
FIELD1 in RECORD4 has the same attributes as FIELD1 in RECORD1.