Previous Topic: FINISHNext Topic: GET


FREE STORAGE (DC/UCF)

The FREE STORAGE statement instructs the system to release all or a part of a variable-storage area. The storage to be released must have been acquired by means of a GET STORAGE request in the issuing task or by another task running on the same terminal as the issuing task. A partial release is valid only for user storage; shared storage must be freed in its entirety.

Syntax
►►─── FREE STORAGE ───────────────────────────────────────────────────────────►

 ►─┬─ STGID (storage-id) ──────────────────────────────────────────────┬─ ; ──►◄
   └─ FOR (storage-location) ─┬──────────────────────────────────────┬─┘
                              └─ FROM (start-free-storage-location) ─┘
Parameters
STGID (storage-id)

Specifies the 4-character identifier of the variable storage area to be released. Storage-id is either the symbolic name of a user-defined field that contains the ID or the ID itself enclosed in single quotation marks.

FOR (storage-location)

Specifies the variable-storage entry of the storage area to be released.

FROM (start-free-storage-location)

Releases a portion of the variable-storage area defined as user storage. Start-free-storage-location is the symbolic name of a user-defined field that contains the starting point of the storage area to be released. The system releases storage from the specified location to the end of the storage area.

Example

The following example releases the storage area identified as 09PA:

FREE STORAGE STGID ('09PA');
Status Codes

Upon completion of the FREE STORAGE function, the ERROR_STATUS field in the IDMS DC communications block indicates the outcome of the operation:

0000

The request has been serviced successfully.

3213

The requested storage ID cannot be found.

3232

The derived length of the variable-storage area is zero or negative.