IBM 5110 User Manual page 131

Apl
Table of Contents

Advertisement

126
After the operation is specified, the CTL shared variable is then used
to specify what records to read or write. To do this, you must assign
a two- or three-element vector to the CTL shared variable, as follows:
o
CTL~
starting record number [number
OJ
records]
o
specifies a read records operation.
If the third element
1 specifies a write records operation.
2 specifies a search by key operation.
(search by key is discussed
is not specified, one
record is assumed.
later in this section).
For example:
CTl..~··P
~:j
~
"-Read three consecutive records, starting with
the sixth record in the file.
Note: The record numbering starts with zero.
o
2
3
4
Therefore, the first record in the file is record number 0, the second is
record number 1, and so on. Also, you cannot read from or write to a
record position that was not originally created using an OUTF or AOO
operation.
When the CTL shared variable specifies a read records operation, the
I/O processor assigns the records read from the data file to the OAT
shared variable. When the CTL shared variable specifies a write
records operation, the data currently assigned to the OAT shared
variable is written to the data file. Therefore, the data must be
assigned to the OAT shared variable before you specify the write
operation. In each case, after reading or writing records, the I/O
processor assigns a return code to the CTL shared variable.

Advertisement

Table of Contents
loading

Table of Contents