Visara Master Console Center Scripting Guide User Manual
Page 139
![background image](https://www.manualsdir.com/files/808700/content/doc139.png)
Chapter 5 Script Commands
Scripting Guide
139
a command being processed, and a console that has failed or hung.
5. The KEY command processing also checks the status line before
sending keys to the console. In this case, if the status line indicates
X SYSTEM or X (clock), it waits for that indication to be removed
from the status line if the user provided a timeout to the KEY
command. For example, if the user entered KEY(%portOS,
"$pjes2[ENTER]", 30), and the status line said X SYSTEM when
this command started, the command waits up to 30 seconds for the
X SYSTEM status to clear. If the command was just KEY(%portos,
"v 000-999,offline[ENTER]"), and the status line contained X
SYSTEM, the command would immediately return the error
(number 5102).
6. If you use the KEY command with a [CLEAR] statement, do not
put additional text in the same statement as KEY ([CLEAR]).
Also, check the return code and take appropriate action if it fails.
7. If sending commands to an HP console, use [RETURN] or [RET] to
send the RETURN key. Do not use [ENTER] or [ENT] unless you
are in block mode, or specifically want to send the [ENTER] key.
Example:
// Logout of a Unix machine using a control-d
$ErrCode := KEY( %OSPort, “[CTRL-D][ENTER]”)
// Logout of a Unix machine using the exit command
%ReturnCode := KEY( %OSPort, “exit[ENTER]”)
// Display the date and time on a mainframe console
%ErrCode := KEY (%OSPort, “d t[ENTER]”, 10)
See Also: