NET/MASTER Network Control Language (NCL) Programmer's Guide
Opening a UDB or UDB Pair for Access by NCL
Working With Files
12–24 106160 Tandem Computers Incorporated
The name of the file, $DATA2.JOHNNCLS.JNFILE, is entered as the first parameter to
the NCL procedure. The NCL process attempts to use FUP to create the file. If FUP is
able to create the file, the UDBCTL OPEN command opens the file for system-wide
access, the FILE OPEN verb opens the UDB for access from NCL, the FILE CLOSE
verb closes the UDB, and the UDBCTL CLOSE command closes the file for access from
NonStop NET/MASTER MS. If FUP is not able to create the file, the NCL process
terminates.
Specifying Different Local
UDB Identifiers
All open UDBs and UDB pairs have one system-wide UDB ID assigned using the
UDBCTL command. This UDB ID is used by the FILE OPEN verb to identify a UDB or
UDB pair when it opens the UDB or UDB pair from an NCL process.
When a FILE OPEN verb opens a UDB or UDB pair, it can specify a different local file
identifier by which subsequent FILE verbs in the same NCL process can refer to the
UDB or UDB pair. This allows a UDB or UDB pair to have one system-wide identifier
but different local file identifiers. It allows the records in a UDB or UDB pair to be
accessed in different ways.
For example, one FILE GET verb can refer to a key-sequenced file using an identifier of
PKEY to access records by primary key while another FILE GET verb refers to the
same key-sequenced file using an identifier of AKEY to access records by alternate key.
If you are using multiple local file identifiers, you can determine the current local file
identifier by interrogating the system variable &SYS.FILE.ID.
When you open a UDB or UDB pair using FILE OPEN, you have four available
identifier options:
After a UDB or UDB pair is assigned a system-wide UDB ID by the UDBCTL
command, the NCL process uses one FILE OPEN verb to open the UDB or UDB
pair. The ID operand of the FILE OPEN verb specifies the UDB ID of the UDB or
UDB pair. The FILE OPEN verb does not use the UDBID operand. This means
that the local file identifier used in the NCL process is the same as the system-wide
UDB ID assigned by the UDBCTL command.
The following code segment illustrates this for a single UDB:
…
INTCLEAR
INTCMD "UDBCTL OPEN=$DATA.SUBVOL.MYFILE ID=UDBID1"
INTREAD
INTCONT
FILE OPEN ID=UDBID1
…
FILE GET ID=UDBID1
…