NET/MASTER Network Control Language (NCL) Programmer's Guide
Setting UDB Characteristics
Working With Files
106160 Tandem Computers Incorporated 12–41
The following code segment opens many files and works with each file in turn:
…
FILE OPEN ID=INPUT_1
FILE OPEN ID=INPUT_2
FILE OPEN ID=INPUT_3
FILE OPEN ID=OUTPUT_1
…
FILE SET ID=INPUT_1
…
/* do some processing */
…
FILE SET ID=INPUT_2
…
/* do some processing */
…
FILE SET ID=INPUT_3
…
/* do some processing */
…
FILE SET ID=OUTPUT_1
…
/* do some processing */
…
FILE CLOSE ALL
…
This example uses a number of FILE SET statements to identify the current UDB for
use by subsequent FILE verbs.
Specifying the Current
Record Structure
The organization of data in a UDB or UDB pair—mapped, unmapped, or delimited—
is normally specified by using the FILE OPEN verb when a UDB or UDB pair is
opened. You can specify the way data is organized in a UDB or UDB pair by using the
FILE SET verb. Refer to the discussion of mapped, unmapped, and delimited UDBs,
earlier in this section, for more information on data organization. The following
example specifies mapped data organization for the specified UDB:
FILE SET ID=FILEID_1 FORMAT=MAPPED MAP=$NCL
Specifying How to Handle
the Record Key
How you want NCL to handle the record key of each record—whether it is regarded
as part of the data in a record—is normally specified by using the FILE OPEN verb
when a UDB or UDB pair is opened. You can specify the way a record key is handled
by using the FILE SET verb. Refer to the discussion earlier in this section for more
information on handling record keys. The following example specifies that the record
key is not regarded as part of the data in a record:
FILE SET ID=FILEID_1 KEYEXTR=YES