PUTRETAIN (Put-Retain) Keyword for Display Files

Use this record- or field-level keyword with the OVERLAY keyword so that the OS/400 program does not delete data already on the display when displaying a record again. The PUTOVR keyword has a function similar to, but more effective than, PUTRETAIN.

This keyword has no parameters.

To understand what effect this keyword has on output operations, consider the following sequence of steps:

  1. Your program sends an output operation to RECORD1, displaying RECORD1. PUTRETAIN, if in effect, is ignored. Any data in the record area for RECORD1 is deleted before RECORD1 is displayed.
  2. At some later time, with RECORD1 still on the display, your program sends a second output operation to RECORD1. Two conditions can occur:
Note:
When using the field-level PUTRETAIN keyword, the entire record area is deleted if none of the fields in the record has PUTRETAIN optioned on. If you specify at least one field with unoptioned field-level PUTRETAIN keyword, this ensures that the record area is not deleted.

If you specify the PUTRETAIN keyword, you should also specify RSTDSP(*YES) on the Create Display File (CRTDSPF) or Change Display File (CHGDSPF) command. Otherwise, data on the display can be lost if the file is suspended.

Option indicators are valid for this keyword.