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

Working With Entry-Sequenced Files
Working With Files
12–52 106160 Tandem Computers Incorporated
Getting a Record From a Delimited Entry-Sequenced File
When you get a record from a delimited entry-sequenced file, NCL returns the data in
a series of variables using the field separators to determine the length and delimit the
contents of each field.
The following code segment gets all records from a delimited entry-sequenced file
beginning at the last record:
/* Get records and displays them on OCS window */
FILE GET OPT=BWD VARS=&field*
DO WHILE &SYS.FILE.RC = 0
DO &fno = 1 TO &SYS.VARCNT
SAY "Field "&fno" is "&field&fno
END /*do*/
FILE GET OPT=SEQ VARS=&field*
END /*do while*/
The FILE GET verb obtains the data in the ordinary &FIELD* variables.
Examples of Working With
Entry-Sequenced Files
This subsection has two examples of NCL procedures that illustrate how to work with
mapped entry-sequenced files. The examples show:
How to add records to a mapped entry-sequenced file
How to get records from a mapped entry-sequenced file
Comments throughout each example describe how it works. You must specify the file
name as the first parameter when you execute each example, for example:
START ZEX1204N $DATA2.JOHNNCLS.MESUDB
Note Before executing each example, you should use the SHOW UDB command to ensure that MESUDB is
not being used as a UDB ID at your installation. If it is, edit the examples so that they use a different
UDB ID.