LIFO (Last-In First-Out) keyword for physical and logical files

You can use this file-level keyword to specify that records with duplicate key values from the same physical file member are retrieved in a last-in first-out (LIFO) order.

This keyword has no parameters.

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

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

At least one key field must be specified in a file containing the LIFO keyword. The LIFO 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 LIFO keyword for a physical file.

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