NET/MASTER Network Control Language (NCL) Programmer's Guide
Working With Edit Files
Working With Files
12–104 106160 Tandem Computers Incorporated
Opening the File for Access
by NCL
It is most meaningful to open an edit file as an unmapped file since NCL has no
control over the structure of the data—NCL can only read records from an edit file.
The following code segment uses the FILE OPEN verb to open a previously created
edit file for access by NCL:
…
FILE OPEN ID=&id FORMAT=UNMAPPED
…
Getting a Record The FILE GET verb retrieves a record from an edit file. One FILE GET verb in an NCL
process retrieves one record from a UDB—an NCL process must issue multiple FILE
GET statements to retrieve multiple records. NCL regards an edit file as an
entry-sequenced file. You can only read edit files in a forward direction.
The following code segment gets all records from an edit file beginning at the first
record:
…
/* Get records and displays them on OCS window */
FILE GET VARS=&record
DO WHILE &SYS.FILE.RC = 0
SAY "Record is "&record
FILE GET VARS=&record
END /*do while*/
…
The FILE GET verb obtains each record in the ordinary &RECORD variable. After
reading a record, you can use the PARSE verb to split it into sections, for example:
PARSE ARGS DATA=&record