Technical data
FREE
FREE
Function
The FREE statement empties selected keeplists or removes a database key value
from a keeplist or currency indicator.
General Format
FREE
database-key-id
ALL
FROM { keeplist-name } . . .
CURRENT
ON ERROR stment
NOT ON ERROR stment2
END-FREE
database-key-id
represents a database key identifier. References are made to a keeplist entry or a
currency indicator according to the rules for Database Key Identifiers.
keeplist-name
names a keeplist in the Subschema Section.
stment
is an imperative statement executed for an on error condition.
stment2
is an imperative statement executed for a not on error condition.
Syntax Rule
Keeplist-name cannot be specified more than once in a given FREE statement.
General Rules
1. If database-key-id references a keeplist entry, the DBCS deletes that keeplist
entry from the keeplist containing it. Removing an entry from a keeplist
changes the position of all subsequent entries in the keeplist.
2. If database-key-id references a currency indicator, the DBCS sets that
currency indicator to null.
3. If ALL is specified and the FROM phrase is omitted, the DBCS empties all
keeplists in the program.
4. If ALL CURRENT is specified, the DBCS nulls all of your currencies. It does
not free entries in a keeplist.
5. If the FROM phrase is specified, the DBCS empties each keeplist-name.
6. The FREE statement releases retrieval update locks on the target record.
7. If a database exception condition occurs during the execution of a FREE
statement, the DBCS places a database exception condition code in the
special register DB-CONDITION (see Technical Note). This code identifies
the condition.
Procedure Division 4–39