Previous Topic: &VARTABLE QUERY

Next Topic: &WRITE


&VARTABLE RESET

Allows an NCL procedure to delete all entries from an existing vartable, while retaining the table definition. (The table is then empty as if it has been FREEd and reALLOCated.) As an option, only the oldest or newest n entries is deleted.

&VARTABLE RESET ID=tablename 
              [ SCOPE={ PROCESS | REGION | SYSTEM | AOM } ] 
              [ OLDEST=n | NEWEST=n ]

Operands:

ID=tablename

(Mandatory) Indicates the name of the table you wish to reset. This must be the name of an existing table within the requested scope.

SCOPE= { PROCESS | REGION | SYSTEM | AOM }

An optional parameter, indicating the scope of the table about which you want to inquire. Allowed values are:

PROCESS

Indicates the table is a private table, visible only to the NCL process that allocated it.

REGION

Indicates the table was allocated with a scope of REGION.

SYSTEM

Indicates that the table is visible to all NCL procedures executing in the same system.

AOM

Indicates that this statement refers to a mirrored VARTABLE. This specification precludes the use of the OLDEST and NEWEST operands.

Note: SCOPE=AOM is available only if your region includes Automation Services products.

OLDEST=n | NEWEST=n

Indicates that, rather than emptying the table completely, only the oldest or newest n entries are to be deleted. This option is useful for tables that are being used as caches.

Examples: &VARTABLE RESET

&VARTABLE RESET ID=MYTABLE

This example will reset the private table called MYTABLE.

&VARTABLE RESET ID=STABLE SCOPE=SYSTEM OLDEST=50

This example resets a table called STABLE, which is visible to all NCL procedures running in this product region. Only the oldest 50 entries are deleted.

Return Codes:

System variable &ZFDBK is set after an &VARTABLE RESET statement to indicate the result of the operation:

0

The table was reset successfully.

16

No table of this name exists in this scope.

20

SCOPE=AOM table in use at the exact time the deletion of the mirrored copy was attempted. The table remains allocated.

&ZFDBK value 20 is possible with AOM tables only. If this happens, the NCL procedure should delay for approximately one second and try again.

Note:

Syntax errors in the &VARTABLE RESET statement terminate the NCL procedure.