
294 Chapter 4
Command Definition F-K
INPUT
INPUT
Permits the user to assign a value interactively to any variable that could otherwise be set
with the SETVAR command. The user may also create an optional prompt string and have
it displayed on $STDLIST before the value is read. (Native Mode)
Syntax
INPUT[ NAME=] varname [ ;PROMPT=prompt] [ ;WAIT=seconds] [ ;READCNT=chars]
NOTE This command follows the optional MPE/iX command line syntax. Refer to
"Optional Format for MPE/iX Commands" at the beginning of this chapter.
Parameters
varname Any variable (that can be set with SETVAR) in which the input string from
$STDIN is stored. If varname does not already exist, INPUT creates it.
prompt The prompt string that is to be displayed on the standard listing device. If
prompt is omitted, nothing displays, but INPUT then waits for an input
value to store in varname. To include delimiters, for example, a comma (,)
or semicolon (;) as part of the prompt string, you must surround the entire
prompt string with quotation marks (“ or ”).
seconds A positive value specifying the number of seconds for a timed read. If a
value is assigned to seconds, the prompt waits seconds for input and then
terminates the command. The default is zero, no time limit.
chars The number of characters you want read from $STDIN. If chars is specified
as a negative number, INPUT uses the absolute integer value. The
maximum allowed (and the default) is the maximum size of a CI variable,
which is currently 1024 characters.
Operation Notes
This command allows the user to assign a value interactively to a variable. It also allows
the user to create an optional prompt message that is displayed on the standard list device
($STDLIST) before the value is read. This command provides a way to establish an
interactive dialog with an executing UDC or command file. If it does not already exist, the
variable varname is always created by INPUT. If you want to delete varname before ending a
session, job, or program, use DELETEVAR varname. Refer to the DELETEVAR command.
CI input redirection can be used to set varname to a record in a file.
NOTE If a colon (:) is read by the INPUT command at any level other than the root
level CI, the error message END OF FILE ON INPUT.
(CIERR 900) is returned.