The FREE statement frees the storage allocated for controlled variables. The freed storage is then available for other allocations. The previously allocated controlled variable is made available, and subsequent references refer to that allocation.
|
Both based and controlled variables can be freed in the same statement. For the syntax of based variables, refer to FREE statement for based variables.
A controlled variable need not be explicitly freed by a FREE statement. However, it is a good practice to explicitly FREE controlled variables.
All controlled storage is freed at the termination of the program.