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

Setting UDB Characteristics
Working With Files
106160 Tandem Computers Incorporated 12–39
INTCLEAR
INTCMD "UDBCTL OPEN="&filename" ID="&id
INTREAD
INTCONT
SAY "Opening UDB from NCL"
FILE OPEN UDBID=&id ID=LOCAL_1
SAY "Current file is "&SYS.FILE.ID
FILE OPEN UDBID=&id ID=LOCAL_2
SAY "Current file is "&SYS.FILE.ID
FILE OPEN UDBID=&id ID=LOCAL_3
SAY "Current file is "&SYS.FILE.ID
FILE SET ID=LOCAL_2
SAY "Current file is "&SYS.FILE.ID
FILE SET ID=LOCAL_1
SAY "Current file is "&SYS.FILE.ID
SAY "Closing UDB from NCL"
FILE CLOSE ALL
SAY "Closing UDB for system-wide access"
INTCLEAR
INTCMD "UDBCTL CLOSE="&filename
INTREAD
INTCONT
END /*do*/
END /*do until*/
END zex1203n
The procedure uses the UDBID and ID operands in the FILE verb to open the same
UDB more than once for access from the same NCL process. The system variable
&SYS.FILE.ID contains the current identifier.
The following screen shows the results of executing the procedure:
(13:05) --------------------- OPERATOR CONTROL SERVICES ----------------------
START ZEX1203N $DATA2.JOHNNCLS.MYFILE
Opening UDB for system-wide access
NNM0300 OPEN REQUEST COMPLETE
Opening UDB from NCL
Current file is LOCAL_1
Current file is LOCAL_2
Current file is LOCAL_3
Current file is LOCAL_2
Current file is LOCAL_1
Closing UDB from NCL
Closing UDB for system-wide access
NNM0300 CLOSE REQUEST COMPLETE
NNM1005 START ZEX1203N PROCESSING COMPLETE. NCLID 001537
_____________________________________________________________________________
---------- ------------------ NonStop NET/MASTER D30 ---------------- --------
M=>