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

Working With Entry-Sequenced Files
Working With Files
106160 Tandem Computers Incorporated 12–51
The following FILE verbs use length variable specifications to split the following
record from an unmapped file:
ABC XYZ 123 789
FILE GET ARGS
&1 = ABC XYZ 123 789
FILE GET VARS=&A*
&A1 = ABC XYZ 123 789
FILE GET VARS=(&A*(1,2),&B*) RANGE=(3,4)
&A1 = ABC XYZ 123 789
FILE GET VARS=(&A(2),&B(2),&C(2),&D(2))
&A = AB
&B = "C "
&C = XY
&D = "Z "
FILE GET VARS=(&A(1),&B(2),*,&D(1))
&A = A
&B = BC
&D = X
The following code segment gets all records from an unmapped entry-sequenced file
beginning at the first record:
/* Get records and displays them on OCS window */
FILE GET VARS=&field* SEGMENT=20
DO WHILE &SYS.FILE.RC = 0
DO &fno = 1 TO &SYS.VARCNT
/* Use | to show exact field length */
SAY "Field "&fno" is |"&field&fno"|"
END /*do*/
FILE GET VARS=&field* SEGMENT=20
END /*do while*/
The FILE GET verb obtains the data in the ordinary &FIELD* variables using the
SEGMENT keyword to ensure that each variable contains exactly 20 bytes.