FCFO (First-Changed First-Out) keyword for physical and logical files

Use this file-level keyword to specify that if records with duplicate key values are retrieved from the same physical or logical file member, the record with the key value that was changed first is the first record retrieved. This is a first-changed first-out (FCFO) order.

This keyword has no parameters.

FCFO is not allowed with an FIFO, LIFO, UNIQUE, or REFACCPTH keyword.

If you do not specify FCFO, LIFO, FIFO, or UNIQUE, records with duplicate key values are retrieved in first-in first-out (FIFO), last-in first-out (LIFO), or first-changed first-out (FCFO) order, but the order in which they are retrieved is not guaranteed.

With the FCFO keyword, the records are ordered by the time the record key value is changed. With the FIFO and LIFO keywords, the records are ordered by the relative record number.

At least one key field must be specified in the file containing the FCFO keyword. The FCFO keyword is not valid when you specify FILETYPE(*SRC) on the Create Physical File (CRTPF) or Create Logical File (CRTLF) command.

Example

The following example shows how to specify the FCFO keyword for a physical file.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A                                      FCFO
00020A          R CUSREC                    TEXT('CUSTOMER RECORD')
00030A            CUSNAMEF      10A
00040A            CUSNAMEM       1A
00050A            CUSNAMEL      10A
00060A          K CUSNAMEL
     A