# Compaq TCP/IP Services for OpenVMS
User's Guide

Previous | Contents | Index

### 4.12.8.1 Associated Documentation

For additional information about TN3270 key functions, see the following IBM documents:

- IBM 3270 Information Display System
- IBM 3270 Information Display System: Operator's Guide
- IBM 3270 Information Display System: 3278 Display Station Operator's Guide

## 4.12.9 Redefining Your Keyboard

You can reassign functions and keys.

### 4.12.9.1 Functions You Can Redefine

You can redefine the following functions:

- All emulated functions
- Most IBM 3270 model functions
- All emulated alphanumeric and graphic characters

### 4.12.9.2 Keys You Can Define

The keys you can define are listed in Table 4-6.

Table 4-6 Definable Keys for TN3270
Type of Key | Key Name
--- | ---
Function keys (VT100 and VT200) | PF1 through PF4
Application keys (VT100 and VT200) | KP0 through KP9 ENTER MINUS COMMA PERIOD
Top-row function keys (VT200) | F6 through F20 HELP (F15) DO (F16)
Editing keypad (E1 through E6) (VT200) | FIND (E1) INSERT_HERE (E2) REMOVE (E3) SELECT (E4) PREV_SCREEN (E5) NEXT_SCREEN (E6)
Cursor keys (VT100 and VT200) | UP DOWN LEFT RIGHT
Control keys (VT100 and VT200) | Ctrl/A through Ctrl/Z, including: Ctrl/H (BS) Ctrl/I (HT) Ctrl/J (LF) Ctrl/M (CR) Excluding: Ctrl/Y---Interrupt Ctrl/C---Cancel/interrupt Ctrl/O---Output off/on Ctrl/S---Suspend output Ctrl/Q---Resume output

### 4.12.9.3 Keys You Cannot Define

You cannot redefine the following keys, which are reserved to Compaq:

- Ctrl/Y --- Interrupt
- Ctrl/C --- Cancel/interrupt
- Ctrl/O --- Output off/on
- Ctrl/S --- Suspend output
- Ctrl/Q --- Resume output
- F1--F5

### 4.12.9.4 Redefining Keys

To redefine a keyboard key, use either of the following methods:

- Create a key definition file. This is a text file with individual key definitions in the form of DEFINE/KEY statements and DELETE/KEY statements (see Section 4.12.9.5).
- Use the DEF KEY function (see Section 4.12.9.5.1).

The following example establishes a TELNET/TN3270 connection to host JUNCO. By default, the terminal functions as if it were an IBM-3278-2 model terminal. It uses your customized keyboard definition file NEW_KEYS.DAT.

    $ TN3270 JUNCO /KEY_DEFINITION=NEW_KEYS.DAT

### 4.12.9.5 Creating a Key Definition File

Use the DEFINE/KEY and DELETE/KEY statements to create your own key definition file, as described in the following sections.

DEFINE/KEY Statement

The DEFINE/KEY statement assigns a new function to a particular key. Use the following syntax for the statement:

    DEFINE/KEY [/STATE=EXTEND] key_name function

/STATE | Optional. Default: nonextend mode. Redefines the key in extend mode.
key_name | Standard key name on the Compaq keyboard.
function | TN3270 function you want mapped to this key.

You can define most of the named keys both in normal (nonextend) mode and in extend mode.

You can define the control keys (and the synonyms for them) in normal mode only. Do not specify the qualifier /STATE=EXTEND.

The following example assigns the EXIT function to the key sequence EXT + Z :

    $ DEFINE/KEY/STATE=EXTEND "Z" EXIT

DELETE/KEY Statement

The DELETE/KEY statement removes the function assigned to a particular key. Use the following format:

    DELETE/KEY [/STATE=EXTEND] key_name

/STATE | Optional. Default: nonextend mode. Deletes the key in extend mode.
key_name | Standard key name on the Compaq keyboard.

Example:

The following example removes the default value of EXIT from Ctrl/Z.

    $ DELETE/KEY [Ctrl/Z]

Key Definition File: Example

By default, TN3270 maps 3270 functions to the numeric keypad.

The following example shows key definition statements in a key definition file. The definitions restore the numeric keypad on a VT220 keyboard.

    DEFINE/KEY     KP0 "0"
    DEFINE/KEY     KP1 "1"
    DEFINE/KEY     KP2 "2"
    DEFINE/KEY     KP3 "3"
    DEFINE/KEY     KP4 "4"
    DEFINE/KEY     KP5 "5"
    DEFINE/KEY     KP6 "6"
    DEFINE/KEY     KP7 "7"
    DEFINE/KEY     KP8 "8"
    DEFINE/KEY     KP9 "9"
    DEFINE/KEY     period "."
    DEFINE/KEY     comma ","
    DEFINE/KEY     minus "-"
    DEFINE/KEY     Select extend
    DEFINE/KEY     Prev_screen reset

This example restores the key normally associated with the EXT function (KP.) as the keypad decimal point. When you assign a key another function, you remove its default value. Therefore, because some TN3270 functions rely on an EXT function, the EXT function is defined to correspond to the Select key. This example also restores the key normally associated with the RESET function (KP0) as the keypad 0 key. The example then defines the RESET function to correspond to the Prev Screen key.

#### 4.12.9.5.1 Interactive Definitions: DEF KEY Function

Use the DEF KEY function to define or redefine a key interactively. Your new definition exists until you log out from the remote host or disconnect from it.

When you invoke the DEF KEY function, TN3270 displays a prompt in the status line at the bottom of your screen.

Example:

The following example shows the use of DEF KEY to define a key. You invoke the DEF KEY function by entering the Ctrl/K sequence, after which you are prompted for the key you want to define and the function to assign to that key.

    [Ctrl/K]
    Press the key that you want to define:

    Enter the function name or quoted character:

You can also use DEF KEY to remove an assigned function. A null reply to the following prompt removes the definition currently in effect for that key:

    Enter the function name or quoted character:

What you enter during the DEF KEY dialog is subject to translation from the National Character Set to the Compaq Multinational Character Set.

You cannot redefine a key that exists on your National Character Set terminal if it lacks a Compaq Multinational Character Set equivalent.

### 4.12.9.6 TN3270 Problem Solving

During a TELNET session in which you have invoked TN3270, you might experience the following problems:

Problem

- The keyboard keys do not work properly.
- Messages, such as the status line messages, do not appear in reverse video.
- You receive a message indicating that your terminal is an unsupported model.
  You cannot use TN3270 on a VT131 model terminal that is running in block mode.

Solution for a VT100-Series Terminal

Use Set-Up mode to verify that your terminal is in ANSI mode. Enter the following command:

    $ SET TERMINAL /INQUIRE

Solution for a VT200-Series Terminal or a Terminal Connected to Either a Personal Computer or a Workstation

1. Use Set-Up mode to verify that your terminal is:
   - In ANSI mode
   - Set to VT100 or VT200 emulation mode
2. Check the Communications Menu:
   The terminal communications line must be set for 8-bit characters. To check, enter the following command:

       $ SET TERMINAL /INQUIRE

Solution for a Terminal with a National Language Keyboard

Ensure that your terminal is set up to correspond to your keyboard.

Problem

You receive a message indicating that the screen size (or the alternate screen size) specified by the remote host is too big.

Solution

Use Set-Up mode to change to a valid screen size (see Section 4.12.1).

Problem

You try to use the RECORD or PLAY function, but you get an error message indicating that you have a bad key-sequence file.

Solution

The file that stores the recorded key sequence is incompatible with the current version of the software or is corrupted.

Ask your system manager to do either of the following:

- Correct TCPIP$RECSEQ.DAT in your SYS$LOGIN directory.
- Delete TCPIP$RECSEQ.DAT.
  If the system manager must delete this file, rerecord all the key sequences you had stored on the PF keys.

## 4.12.10 Debugging Application Programs Using the IBM 3270 Model Terminal Emulator

Visible attribute mode provides a way to debug application programs. After you use the DSP ATT (display attributes) function to enable visible attribute mode, all attribute characters are visible. Attribute characters are characters that appear at the start of a field to indicate the following information:

- How the field appears on the screen:
  - At normal intensity
  - At high intensity
  - Invisibly
- What type of data the application expects in the field:
  - Numeric
  - Alphabetic
  - Alphanumeric

The following information shows:

- How to enter and exit visible attribute mode (see Section 4.12.10.1)
- The screen displays (see Section 4.12.10.2)

### 4.12.10.1 Entering and Exiting Visible Attribute Mode

The displays described in this section rely on your terminal's ability to produce reverse video and bold characters.

Invoking the DSP ATT function toggles in and out of visible attribute mode.

- The first time you invoke this function, the following actions take place:
  - The screen is refreshed.
  - The attribute characters appear either in reverse video or underlined.
- The second time you invoke this function, the following actions take place:
  - This mode is turned off.
  - The screen is refreshed and returns to normal mode.

### 4.12.10.2 Visible Attribute Mode Displays

The attribute characters are displayed in reverse video, bold symbols. Attribute characters indicating numeric fields are also underlined. All other characters are displayed normally. Table 4-7 lists the attribute characters and their meanings.

Table 4-7 Displays in Visible Attribute Mode
Character | Meaning
--- | ---
n | Unprotected field with normal intensity follows.
N | Protected field with normal intensity follows.
d | Following unprotected field is light-pen-detectable.
D | Following protected field is light-pen-detectable.
h | Following unprotected field has high intensity.
H | Following protected field has high intensity.
i | Unprotected nondisplay field follows.
I | Protected nondisplay field follows.

# 4.13 Command Descriptions

To start TELNET, enter either the TELNET command or the TN3270 command at the DCL prompt.

To use TELNET commands, enter them at the `TELNET>` prompt.

This section provides complete descriptions of each TELNET command. The related ENABLE and DISABLE commands are presented together (see the description for ENABLE).

# CONNECT

> Establishes a TELNET connection between your local system and a remote host. You can run one session or 10 or more simultaneous sessions (only one session if you invoke TN3270).

## DCL Format

> CONNECT host [ port* [ terminal_type ] ]

> * Required if you specify terminal type.

## UNIX Format

> open host [ port ] [ terminal_type ]

## Parameters

> ### host

> Required.

> Remote host to which you want to connect.

> ### port

> Optional without terminal_type.
> Required with terminal_type.
> Default: 23.

> TELNET port on the remote host. Specify this parameter if:

> - You are invoking TN3270.
> - You are connecting to a host that does not use the standard TELNET port.

> ### terminal_type

> Optional. Default: model of your physical terminal.

> Terminal model that you want your physical terminal to function as. Specify one of the following:

> - For a session running TN3270, the terminal model to emulate. Enter one of the following:
>   - IBM-3278-2
>   - IBM-3278-3
>   - IBM-3278-4
>   - IBM-3278-5
> - For a non-TN3270 session, any terminal type recognized by the remote host, such as VT100, VT200, VT300, VT400, and VT500.

##

### Examples

#1
    TELNET> CONNECT MYBUD

> Establishes a TELNET connection to remote host MYBUD.

#2
    TELNET> CONNECT DEBTS 23 IBM-3278-2

> Establishes a TELNET connection to remote host DEBTS and runs TN3270. Your terminal functions as an IBM-3278-2 model terminal. For syntax reasons, specifying a port number is required.

#3
    TELNET> CONNECT 130.180.5.5

> Establishes a TELNET connection to the host at IP address 130.180.5.5.

#4
    TELNET> CONNECT REVIN 31

> Establishes a TELNET connection to remote host `revin` . The connection is at port 31 on `revin` .

#5
    % [Ctrl/]]
    TELNET> CONNECT QUIK
       .
       .
       .
    %

> During a TELNET session with a UNIX host, pressing Ctrl/] escapes to the TELNET prompt. Another CONNECT command establishes a second session, this one to UNIX host `quik` .

# BIND_SESSION

> Creates a TELNET terminal device (TNAx:) and connects to a network device (BGx:). If successful, returns the TNA device name (TNAx:) in the DCL symbol $TELNET_DEVICE. Network input and output operations can then be performed through the created TELNET device using terminal driver $QIO operations.

## DCL Format

> BIND_SESSION network_device [ /PROTOCOL=option ]

## Parameters

> ### network_device

> Required.

> An existing network device.

## Qualifiers

> ### /PROTOCOL=option

> Optional. Default: NONE.

> Options include:

> - NONE
>   Data is sent with no interpretation (raw).
> - NVT
>   Network Virtual Terminal (NVT), TELNET's internal representation of a standard network terminal. NVT format is standard 7-bit ASCII code transmitted in 8-bit octets, the canonical form of data representation used by both the client and server.
> - TELNET
>   Standard TELNET protocol.
> - RLOGIN
>   Standard RLOGIN protocol.

## Example

    TELNET> BIND_SESSION BG393: /PROTOCOL=NVT

# CREATE_SESSION

> Establishes an outbound TELNET pseudodevice (network terminal) and connects it to a remote listener (port).

## DCL Format

> CREATE_SESSION host port [ unit ]

> [ /[ NO ]TIMEOUT=option ]
> [ /PROTOCOL=option ]

## Parameters

> ### host

> Required.

> Remote host to which you want to connect.

> ### port

> Required.

> TELNET port on the remote host.

> ### unit

> Optional. Default: 0

> The decimal number specifying the unit number for the pseudodevice (TNAx). The default 0 specifies that TCP/IP Services should pick the next available unit number. If the requested unit number is already in use, the next available unit number is used. In all cases, the software notifies you of the unit number chosen.

## Qualifiers

> ### /TIMEOUT

> ### /NOTIMEOUT

> Optional. Default: /NOTIMEOUT
> - /TIMEOUT
>   Creates a TNA device that has the following connection attributes:
>   - NOIDLE---The connection is broken when the device is finally deassigned. The device will automatically reconnect when data is written to it.
>   - IDLE---Specifies the idle time for the device. If the device is idle for at least the specified amount of time (note that the time has a granularity of one second), then the connection will be broken. Idle means that the device has neither received nor sent any data for the idle period.
>   - NORECONNECTION---The device does not automatically retry reconnections if they fail.
>   - RECONNECTION---When data is written to the device and the device is not connected, this value determines the interval between reconnection attempts. For example, if an application writes to a TNA with a RECONNECTION-0:1:00, and if the first connection attempt fails, then subsequent connection attempts will be made in 1-minute intervals.

> - /NOTIMEOUT
>   Creates a TNA device that breaks the connection when the device is finally deassigned (the last channel assignment is deassigned).

> ### /PROTOCOL=options

> Optional. Default: NONE. Options include:
> - NONE
>   Data is sent with no interpretation (raw).
> - NVT
>   Network Virtual Terminal (NVT), TELNET's internal representation of a standard network terminal. NVT format is standard 7-bit ASCII code transmitted in 8-bit octets, the canonical form of data representation used by both the client and server.
> - TELNET
>   Standard TELNET protocol.
> - RLOGIN
>   Standard RLOGIN protocol.

## EXAMPLES

#1
    TELNET> CREATE_SESSION DEBTS 23 2

> Establishes a network terminal known as TNA2, and connects this device to port 23 on remote host DEBTS.

#2
    TELNET> CREATE_SESSION
    /TIMEOUT=(NOIDLE, RECONNECTION=NN)

> Creates a device that disconnects on deassignment and reconnects when data is written to it.

#3
    TELNET> CREATE_SESSION /NOTIMEOUT

> Creates a device that is not reusable; the device disconnects on deassignment and is deleted.

#4
    TELNET> CREATE_SESSION /TIMEOUT=(IDLE=0:0:30, RECONNECTION=0:2:00)

> Creates a device that times out after being idle for 30 seconds and that retries connection attempts at 2-minute intervals.

Previous | Next | Contents | Index