MPE/iX Commands Reference Manual (32650-90877)

Chapter 7 245
Command List V
Commands HEADOFF thru LISTF
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.
INPUT reads a value from the standard input device ($STDIN) and stores it as a string in
the variable named
varname
. If
varname
does not exist, INPUT creates it. If
prompt
is
omitted, nothing is displayed, and INPUT waits for an input value to store in
varname
. The
variable
varname
can be used as you would use any other MPE/iX string variable.
CI input redirection can be used to set varname to a record in a file.
NOTE
The INPUT command does not evaluate an expression before assigning its
value to
varname
. The command recognizes only strings. Expressions such as
9 + 3 are treated as strings, even though they are not surrounded by
quotation marks (“ or ”).