The input source is defined in the INPUT operand. By default, the data display terminal *TERMINAL is set as the input source. However, this input source can also be defined as:
the terminal
a cataloged file
a variable
a library element
the SYDTA system file
The way in which values that have been read in are assigned to a variable depends on the entries in the VARIABLE-NAME operand (see "READ-VARIABLE Assign values to variables ").
Terminal
The inputs are read from the terminal (= *TERMINAL). Each input that is terminated with the transmit key is then regarded as a variable value.
The suboperand SECRET-INPUT provides the additional possibility of secret input from a terminal into a protected (blanked) field.
User file / library element
User files and library elements differ only in the way in which they are stored and, thus, in the way in which their names are entered. If a user file or library element is specified as an input source, each data record is interpreted as a value that is assigned to a variable.
In the case of ISAM files, it is possible to specify whether the ISAM key is to be retained or removed at the time of input. Unless otherwise specified, the ISAM key is removed and only the remainder of the data record is assigned to a variable.
List variable
If a list variable is specified as the input source, this list must be declared with the *STRING data type and have valid contents. (The list can also be declared with the data type *ANY if it only contains string values.)
Each element of this list is then valid as a value that can be assigned to a variable.
SYSDTA system file
Data is read from SYSDTA exactly as it is from a file. However, there is one exception: If the read operation is terminated before SYSDTA EOF, the next SYSDTA record is accessed the next time data is read in from SYSDTA. This allows reading of specific data from SYSDTA. This is useful, for example, if only a single simple variable is to be read.
Input ends at the end of the SYSDTA system file, i.e. either at the end of the file if a cataloged file is assigned to SYSDTA, or with the next command if SYSDTA is assigned to SYSCMD (default value for S procedures).
It is not possible to interrupt the input of data read from SYSDTA by means of HOLD-PROGRAM,
or BEGIN-BLOCK PROGRAM-INPUT=*MIXED-WITH-CMD (in order to switch to command mode). These commands and actions only result in the termination of input, i.e. SYSDTA EOF (end-of-file) being reported to the appropriate command. Only the SEND-DATA command does not terminate the READ-VARIABLE command.