The verb in COBOL that does this is ALLOCATE
. Only assignment can be used with a data item defined as BASED
(which indicates that the compiler does not allocate the usual storage for the data item). FREE
free the storage obtained by allocating.
ALLOCATE / BASE / FREE exist since the 2002 Standard which was replaced by the 2014 Standard. The implementation is down to the compiler vendor and not all compilers support this.
All COBOLs will have additional ways to allocate storage assigned to a POINTER
value through a system call of some kind.
There is also a way to load, but not execute, "a program" that contains the storage (usually for reference), using a PROCEDURE- POINTER
(or a FUNCTION-POINTER
).
CALL
is used in many ways to do many things, including allowing access to storage outside of the currently active program. If something does not exist, you can always write a program and CALL it.