ALLOCATE statement

Other topics

Remarks:

Allocate working storage for a BASED item, or allocate a give size of heap storage.

See also: FREE statement

ALLOCATE syntax diagram

ALLOCATE statement

01 pointer-var         usage POINTER.
01 character-field     pic x(80) BASED value "Sample".

ALLOCATE 1024 characters returning pointer-var
ALLOCATE character-field
ALLOCATE character-field INITIALIZED RETURNING pointer-var

See http://open-cobol.sourceforge.net/faq/index.html#allocate for more details.

Contributors

Topic Id: 5556

Example Ids: 19741

This site is not affiliated with any of the contributors.