KEEP (Keep) keyword for display files

You use this record-level keyword to keep the display from being deleted when the display file is closed.

The entire display is kept if any of the records on the display have KEEP specified. The default causes the entire display to be deleted when the file is closed.

In addition, the name of the first, uppermost record on the display that has the KEEP attribute is saved by the IBM® i operating system for possible use by subsequent programs. The name kept can be used by a subsequent program that does not specify a record name on its first input operation. This keyword enables you to leave data on the display for review after your program ends, or use that data as input for subsequent programs.

This keyword has no parameters.

This keyword cannot be specified with the following keywords:

ALWROL
CLRL
SLNO

A warning message appears at file creation time if the KEEP keyword is specified on a record with the DSPMOD keyword. At run time, the KEEP keyword is ignored when the display mode changes.

Option and response indicators are not valid for this keyword.

Example

The following example shows how to specify the KEEP keyword.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00061A          R REC46                     KEEP
     A