NET/MASTER Network Control Language (NCL) Programmer's Guide
Setting UDB Characteristics
Working With Files
12–38 106160 Tandem Computers Incorporated
Unmapped UDBs. It is recommended that you set KEYEXTR=NO when you are
working with an unmapped UDB.
If you are working with a key-sequenced file, you must exclude the record key from
your calculations when you retrieve a record if you specify that the file is unmapped
and set KEYEXTR=YES. In contrast, you must include the record key in your
calculations when you retrieve a record if you specify that the file is unmapped and set
KEYEXTR=NO.
Delimited UDBs. In a delimited, key-sequenced file, if you specify KEYEXTR=NO, your
first variable contains the record key and the data of the first field. Accordingly, you
must be aware of the position of the first field delimiter in a record if you specify
KEYEXTR=NO.
Setting UDB
Characteristics
All UDBs and UDB pairs have unique characteristics. After you open a UDB or UDB
pair, you can use the FILE SET verb to explicitly set the current UDB characteristics.
Specifying the Current UDB
Identifier
The current UDB or UDB pair is the last UDB or UDB pair explicitly identified in a
FILE verb. The current UDB or UDB pair is the UDB or UDB pair with which NCL
assumes it is to work if a FILE verb does not explicitly target a UDB or UDB pair. You
use the ID operand in a FILE verb to explicitly specify an identifier.
You can set the current UDB or UDB pair in two ways:
Using the FILE SET verb with the ID operand
Using any other FILE verb that identifies a UDB by identifier
Either technique results in a new current UDB or UDB pair. The result of setting a
UDB or UDB pair as the current UDB or UDB pair is that FILE verbs (except FILE
OPEN) do not have to explicitly identify a UDB or UDB pair to work on it.
The following NCL procedure uses the FILE OPEN and FILE SET verbs to set the
current UDB:
zex1203n: PROCEDURE
/* Uses FUP to create a new entry-sequenced file */
/* Opens file using UDBCTL OPEN and FILE OPEN */
/* Fully qualified file name is first parameter */
/* Displays current identifier with &SYS.FILE.ID */
&filename = &1
&id = ZEX1203N
ON ERROR FLUSH
INTCMD "OPSYS SEND FUP CREATE "&filename,
", TYPE E"
DO UNTIL &msgno = "NNM0999" OR &found > 0
INTREAD VARS=(&msgno(7),*,&text),
TYPE=ANY PARSE=NO
&found = POS("CREATED -",&text)
IF &found > 0 THEN DO
/* FUP has created a new file */
SAY "Opening UDB for system-wide access"