NET/MASTER Network Control Language (NCL) Programmer's Guide
Closing a UDB or UDB Pair for Access by NCL
Working With Files
12–42 106160 Tandem Computers Incorporated
Specifying the Current
Record Key
The current record key is the value of the last record key that was explicitly identified
in a FILE verb. It is the record key with which NCL assumes it is to work if a FILE
verb does not explicitly set a record key. You use the KEY operand on a FILE verb to
explicitly specify a record key.
Identifying a record key is valid only if you are working with key-sequenced UDBs.
You cannot specify a record key if you are working with entry-sequenced files.
You can set the current record key in two ways:
Using the FILE SET verb with the KEY operand.
Using any other FILE verb that can identify a record key (FILE ADD, FILE DEL,
FILE GET, or FILE PUT).
Either technique results in a new current record key. The result of setting a record key
as the current record key is that FILE verbs do not have to explicitly identify a record
key to access the record.
After a successful FILE GET operation, the current record key is set to the key of the
record just retrieved.
The following example sets the current record key to RECORD1. The FILE GET verb
attempts to retrieve a record with this record key. If it finds the record, it locks the
record.
FILE GET ID=LOG_01 KEY=RECORD1 OPT=UPD ARGS
Closing a UDB or UDB
Pair for Access by
NCL
The FILE CLOSE verb closes a file for access by NCL. You can close a single UDB or
UDB pair, identified by its UDB ID, or all UDBs and UDB pairs that the NCL process
has opened, specified by using ALL. The following example closes a single UDB or
UDB pair:
FILE CLOSE ID=FILEID_1
The following example closes all open UDBs and UDB pairs:
FILE CLOSE ALL
The following code segment closes a UDB:
…
SAY "Closing "&filename
FILE CLOSE ID=&id
…
Note The FILE CLOSE verb does not close a UDB or UDB pair for access by NonStop NET/MASTER MS.
You must use the UDBCTL CLOSE command to do this.