Example: A physical file with a new record format
This example uses fields in a reference file (REF keyword) and uses a keyed-sequence access path.
The REF keyword is important in this example. This file has one record format. The names of all fields in the record format are specified.
The following physical file (called CUSMSTP for customer master physical file) describes the fields physically present in the database.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A*
00020A* SAMPLE PHYSICAL FILE(CUSMSTP)
00030A*
00040A (1) REF(MLGREFP)
00050A (2) R CUSMST TEXT('Customer Master Record')
00060A ACTNUM R (3)
00070A NAME R (3)
00080A ADDR R (3)
00090A CITY R (3)
00100A STATE R (3)
00110A ZIP R (3)
00120A (4) SEARCH 10 0
00130A (4) CRDLMT 8 2
00140A (5) K ACTNUM
A
Legend:
- (1)
- At the file level, the REF keyword refers the IBM i operating system to the physical file MLGREFP, which is a field reference file for this database.
- (2)
- At the record level, R in position 17 specifies that CUSMST is the record format name of the record in this file. (There can only be one record format in a physical file.)
- (3)
- At the field level, Rs in position 29 specify that the attributes of fields of the same name in the REF file are to be used as attributes of these fields.
- (4)
- The fields SEARCH and CRDLMT are not defined in MLGREFP; therefore, their field attributes are specified here.
- (5)
- At the key field level, K in position 17 specifies that ACTNUM is the key field for the file.