Modifying Function Options › Identifying Standard Function Options › Closedown Program
Closedown Program
This option specifies whether the RPG Last Record Indicator is set on when the program finishes execution.
- If Y is specified, all files are closed and the program is shut down
- If N is specified, all files remain open and a subsequent call is faster and performs a full program initialization
Notes:
- In either case, all internal variables are initialized to blanks and zeros on each call. If closedown is N, arrays are not cleared. This permits arrays to be used to store WRK variables. The PGM context variable *INITIAL CALL is available to determine if this is a first time subsequent call.
- COBOL has no direct equivalent of the RPG Last Record Indicator. The top-level program initiates the Run Unit. All programs called from this top program remain in the Run Unit until the top-level program itself closes down.