COBOL Initialize

COBOL Go Back COBOL Inspect Statement

Advertisements


INITIALIZE sets the data items to the predefined values based on the data types.

INITIALIZE can initialize single data item or a group of data items.

INITIALIZE set the predefined values based on data types like below.

If the data type is alphabetic/alphanumeric/alphanumeric-edited, those data items will be initialized with SPACES.

If the data type is numeric/numeric-edited, those data items will be initialized with ZEROES.

During the INITIALIZE, FILLER and OCCURS DEPENDING ON items will not be effected.

Syntax:
	INITIALIZE identifier-1
	[REPLACING {ALPHABETIC/ALPHANUMERIC/NUMERIC}	
		DATA BY identifier-2.

REPLACING clause is optional in INTIALIZE.

REPLACING is used to replace particular value(other than predefined value) based on data type during the initialization.


If any questions on the above, post your queries on Cobol Discussion forum


COBOL Go Back COBOL Inspect Statement

Advertisements