INIT-BY-TYPE

Initializes Working-Storage data items to a default value, according to their type.

Syntax:

>>-.---.-.----.--INIT-BY-TYPE---------------------><
   +-/-+ +-NO-+

Parameters:

None

Properties:

Default: NOINITBYTYPE
Phase: Syntax check
$SET: Initial

Comments:

Normally, the compiler will initialize all data items to spaces or the value specified by the DEFAULTBYTE directive, except for those items given a VALUE clause. If this option is specified, data items are initialized according to their type:

  • Alphabetic, alphanumeric, alphanumeric edited, and numeric edited items are initialized to spaces.
    Note: For an OSVS dialect, numeric edited items are initialized to zeroes.
  • Numeric items are initialized to zero.
  • Pointer items are initialized to null.
  • Index items are initialized to the value 1.

Automatic initialization applies only to Working-Storage, and does not apply to any item that (a) is given a VALUE clause (including via a higher group level) (b) is EXTERNAL, or (c) is subordinate to a REDEFINES phrase.

This directive is incompatible with the INITIAL directive; if you specify the two together, a syntax checker error is generated.