Use the SEND_KEY statement to simulate keyboard input to the current 3270 screen at the current cursor position. This statement can be used to send anything that can be typed on a 3270 terminal, including keyboard keys, strings, numbers, or variable names. Special keywords are provided for keyboard keys, such as ENTER, PA1, PF1, PF2, and so on. For a list of the keywords, select Keys in the Send Key Definition window. See Table 1 and Table 1 for lists of 3270 and AS/400 key equivalents.
When multiple parameters are specified, they are sent to the 3270 screen in sequence. However, it is recommended that you use a separate SEND_KEY statement to send the characters for each field. Do not try to send enough characters to fill in two or three fields with one SEND_KEY statement.
If the 3270 terminal emulation session is in keyboard lock condition (indicating that the host system is busy), when the SEND_KEY statement is executed, the EX_KEYB_LOCK exception definition script is invoked. By default, the script is abnormally terminated. To handle a failed SEND_KEY statement in a different way, you need to write an exception handler for this condition, as described in EXCEPTION.
SEND_KEY ( ENTER, TAB, "Jason" );
To use the 3270 Script window’s Statements menu to define a SEND_KEY statement, follow this procedure:
The system displays the Send Key Definition window.
If you select multiple values then wish to start over, click Clear to clear the selection list.
The SEND_KEY statement is added to the script.