NET/MASTER Network Control Language (NCL) Programmer's Guide

Controlling Access to UDBs by NonStop NET/MASTER MS
Working With Files
106160 Tandem Computers Incorporated 12–13
The following code segment opens the UDB pair from an NCL process and then
assigns the identifier UDBID1 to the UDB pair after the UDB pair is opened:
/* Opens the UDB pair without a UDB ID */
INTCMD "UDBCTL OPEN=($DATA.SUBVOL.MYFILE1,",
"$DATA.SUBVOL.MYFILE2)"
/* Assigns a UDB ID to the UDB pair */
INTCMD "UDBCTL ($DATA.SUBVOL.MYFILE1,",
"$DATA.SUBVOL.MYFILE2)=UDBID1"
Opening a UDB or UDB Pair for Read-Only Access
When you open a single UDB, it is opened by default for both read access and write
access. If you want to open a single UDB for read-only access, you must specify
INPUT as the qualifier to the UDBCTL OPEN command. The following example
opens the UDB MYFILE for read-only access and assigns the identifier UDBID1 to
MYFILE:
UDBCTL OPEN=$DATA.SUBVOL.MYFILE ID=UDBID1 INPUT
When you open a UDB pair, the first file you specify is opened by default for both read
access and write access, the second (always) for read-only access. If you also want to
open the first file for read-only access, you must specify INPUT as the qualifier to the
UDBCTL OPEN command. The following example opens the UDB MYFILE1 (in
addition to MYFILE2) for read-only access, and assigns the identifier UDBID1 to the
UDB pair:
UDBCTL OPEN=($DATA.SUBVOL.MYFILE1,$DATA.SUBVOL.MYFILE2)
ID=UDBID1 INPUT
Performing a RESET Operation on a UDB or UDB Pair
You can perform a RESET operation on a single UDB or the first file in a UDB pair.
A RESET operation logically (but not physically) removes all data from a UDB. It does
so by setting the EOF pointer to the beginning of the UDB. The UDB still exists after a
RESET operation. You can display the UDB by using the SHOW UDB command;
however, it logically contains no data.
You can perform a RESET operation on a single UDB before you open it or when you
open it. You can perform a RESET operation on the first file in a UDB pair when you
open the pair.
(The RESET operation performs the same function as the Guardian PURGEDATA
operation. Refer to the File Utility Program (FUP) Reference Manual for additional
information on PURGEDATA.)