The initialization operations provide run-time clearing and resetting of all elements in a structure (record format, data structure, array, or table) or a variable (field, subfield, or indicator).
The initialization operations are:
The CLEAR operation sets all elements in a structure or variable to zero, blank, or '0', depending on the field type (numeric, character, or indicator). This allows you to clear structures globally, instead of element by element.
The RESET operation sets all elements in a structure or variable to their initial values (the values they had at the end of the initialization step in the program cycle).
The RESET operation is used with data structure initialization and the initialization subroutine (*INZSR). You can use both data structure initialization and the *INZSR to set the initial value of a variable. The initial value will be used to set the variable if it appears in factor 2 of a RESET operation.
When these operation codes are applied to record formats, only fields which are output are affected. See CLEAR (Clear) and RESET (Reset) for more detail.
For more information see "Initialization" in Chapter 9 of the RPG/400* User's Guide.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.