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

Previous | Contents | Index

# 4.8 Suspending TELNET to Return to the Local DCL Prompt

While using TELNET, you can use the SPAWN command to suspend your current session and create a subprocess at the local DCL prompt. At the DCL prompt, you can then enter any number of DCL commands. To return to your suspended TELNET session (exiting the DCL subprocess), enter the LOGOUT command.

In the following example, the user suspends the TELNET session to list the files in the working directory on the local host and deletes one of the files in that directory and then returns to the TELNET session.

    TELNET> SPAWN
    $ DIR
       .
       .
       .
    $ DEL TR3.TXT:*
    $ LOGOUT
    Process FERN_1 logged out at 17-JAN-2002 11:08:24.90
    TELNET>

# 4.9 Multiple Sessions

TELNET supports:

- Multiple simultaneous connections
- 10 or more simultaneous sessions
- Only one session at a time if it uses TN3270

The TELNET command SHOW STATUS helps you keep track of multiple sessions. The SHOW STATUS display uses the terms shown in Table 4-2.

Table 4-2 Terminology Used in TELNET Command SHOW STATUS Display
Term | Meaning
--- | ---
Active host | Host from which you entered the escape sequence to return to the TELNET prompt.
Current session | If you log out of the active host at its system prompt, or enter the TELNET command DISCONNECT, no current session exists. To resume a connection, even if only one exists, enter the following command:
    TELNET> RESUME
    n
Waiting hosts | Other hosts with whom you have open sessions, numbered in the order that you connected to them. To resume a connection with a waiting host, even if only one exists, enter the following command:
    TELNET> RESUME
    n

To open another TELNET connection, perform the following steps:

1. At the system prompt of the remote host, enter the TELNET escape sequence (default is Ctrl/]).
2. TELNET returns to the TELNET prompt.
3. Start another session by issuing the CONNECT command.

The following example starts multiple sessions with UNIX hosts `finder` and `keeper` .

    $ TELNET FINDER
       .
       .
       .
    finder> ()
       .
       .
       .
    finder> [Ctrl/]]     (characters not echoed)
    TELNET> CONNECT KEEPER
       .
       .
       .
    keeper> ()
       .
       .
       .
    keeper> [Ctrl/]]     (characters not echoed)
    TELNET> ()

## 4.9.1 Toggling Between Open Sessions

To toggle between one open TELNET connection and another:

1. Enter the TELNET escape sequence.
2. If necessary, use the SHOW STATUS command to check the number of your session with the other host.
3. Enter the TELNET RESUME n command, where n is the number of the session to which you want to return.

For an example, see Section 4.7.

## 4.9.2 Displaying Session Information

To display a list of your active sessions, use the following SHOW SESSION command:

    TELNET> SHOW SESSION [Return]
    Session 01, host finder, port 23
    Session 02, host keeper, port 23 (default active session)

If there are no active connections, the SHOW SESSION command displays the following message:

    %TELNET-E-NOSESSION, No active session

# 4.10 Customizing TELNET/TN3270 Transmissions, Control Characters, and Displays

To customize the TELNET/TN3270 processing environment, use the ENABLE, DISABLE, and SET commands. You can modify how TELNET and TN3270 perform the following actions:

- Send and receive transmissions
- Display processing on your terminal
- Interpret certain control characters

You can redefine the following control characters, in situations when, for example, your terminal or the remote host does not recognize the corresponding default control character.

- Echo
- Erase
- Escape
- Flush output
- Interrupt
- Kill
- Quit

Use the SET command to redefine these characters. For example, the following command defines the interrupt character to be the letter a or A.

    TELNET> SET INTERRUPT "^a"

TN3270 allows you to redefine your keyboard. You can redefine most IBM 3270 model functions and all emulated functions and characters. You can create a key definition file with DEFINE/KEY statements to redefine the keyboard. Alternatively, you can redefine a key interactively by using the DEF KEY function (Ctrl/K on VT100-and VT200-series terminals) (see Section 4.12.9.)

You can determine the mode TELNET uses to transmit data. The appropriate TELNET mode for a session depends on:

- The remote host to which you are connecting
- The applications you use

Table 4-3 shows the modes that control TELNET communications.

Table 4-3 TELNET Transmission Modes
Mode | Function
--- | ---
Local Characters Mode | The local host interprets control characters, translating them to TELNET protocol sequences (ENABLE LOCAL_CHARS). Use this mode when the local and remote hosts implement different control characters. By default, characters are interpreted by the remote host (DISABLE LOCAL_CHARS).
Binary Mode | The local host sends transmissions in binary mode (ENABLE BINARY). Use this mode when the remote host expects each line of data to end with a carriage return/line feed combination. By default, the local host sends transmissions with the end-of-line (EOL) character mapped to the carriage return/line feed combination (DISABLE BINARY).
Debug Mode | TELNET displays data flow in both hexadecimal and readable text (ENABLE DEBUG). By default, TELNET displays data in readable text only (DISABLE DEBUG).
Character Transmission Mode | TELNET transmits data one character at a time (SET MODE CHAR) rather than line by line. Use this mode when you run a text editor (on the remote host) that does character processing. Character transmission mode is the default.
Line Transmission Mode | TELNET transmits data one line at a time (SET MODE LINE). Most clients send a character at a time. The remote host server must support line transmission mode. This allows you to do signal trapping as well as local-character editing and tab expansion.

# 4.11 Sending Commands to the Connected Remote Host

While in input mode (an active session with a remote host), you can enter SEND commands that affect the remote host's processing of commands you have entered. You use these commands when the remote host does not recognize the default key or key sequence used for the same operation. You can use the SEND AYT and SEND NOP commands to determine whether or not your session with the remote host is still open. Table 4-4 lists the functions available to you at the remote host with each SEND command.

Table 4-4 Sending Commands to the Remote Host
Function | Command | When to Use
--- | --- | ---
Abort output of the last remote command you entered, without discontinuing execution of the process. | SEND AO | You want to terminate output but not the execution of the process. After already aborting output, you want to resume output. The remote host does not recognize the Ctrl/O sequence as the flush output character.
Determine if your connection with the remote host is still established. The remote host replies with connection status information. | SEND AYT | Test the connection to the remote host application and verify that the remote host application is responding. You are notified on success.
Terminate execution of the last command you entered at the remote host. | SEND BRK | The remote host does not recognize the Ctrl/C sequence as an interrupt character.
Delete the last character you entered at the remote host. | SEND EC | The remote host does not recognize your Delete key.
Delete the last line of text you entered at the remote host. | SEND EL | The remote host does not recognize your Delete key or command-line recall.
Signal the remote host that your local system is ready. | SEND GA | The application requires GA commands in either one or both directions.
Interrupt execution of the last command you entered at the remote host. | SEND IP | Your terminal or the remote host does not recognize the default interrupt character (Ctrl/C).
Determine whether your local host can send data to the connected remote host and whether the remote host can receive that data. | SEND NOP | Check the communication path to the remote host. You are notified on error.
Interrupt the current process you are executing at the remote host, and in urgent mode (out-of-band), get a quicker response time to the interrupt. | SEND SYNCH | You want to clear immediately the communications path between your system and the remote host, with the remote host ignoring any incoming data not yet processed.

# 4.12 IBM 3270 Model Terminal Emulation (TN3270)

You can run a TELNET session with a host that uses IBM 3270 model terminals by using the TN3270 command. The TN3270 command:

- Provides IBM 3270 Information Display System (IDS) terminal emulation.
- Assigns IBM 3270 functions to your Compaq keyboard.
- Assigns IDS functions to specific keys.

During a TN3270 session, you can do the following:

- Record your sessions ( Section 4.12.5).
- Redefine keys permanently ( Section 4.12.9.5).
- Redefine keys interactively ( Section 4.12.9.5.1).
- Troubleshoot problems ( Section 4.12.9.6).

Note When you run TN3270, you can only have one session. You cannot have other sessions running simultaneously, as you can when running normal TELNET sessions.

## 4.12.1 Supported IBM Terminal Models

Table 4-5 lists the IBM 3270 terminal models that TELNET/TN3270 can emulate.

Table 4-5 TELNET --- IBM 3270 Model Terminals Supported for Telnet/TN3270
Model | Screen Size (Rows x Columns)
--- | ---
IBM 3278 Model 2 | 24 x 80
IBM 3278 Model 3 | 32 x 80
IBM 3278 Model 4 | 43 x 80
IBM 3278 Model 5 | 27 x 132

## 4.12.2 Setting Up Your PC or Terminal for IBM 3270 Terminal Emulation

When you use TELNET and specify IBM 3270 model terminal emulation (TN3270), the image displayed on your screen depends on the following criteria:

- The type of terminal that you are using or that your PC is emulating
- The features you set on it

Sections 4.12.2.1 and 4.12.2.2 explain how to set up VT200- and VT100-series terminals (or emulation on PCs), respectively.

### 4.12.2.1 VT200-Series Terminal Setup

To set up a VT200-Series terminal for emulation, follow these steps:

1. At the Set-up Directory menu, select the keyboard type that corresponds to the keyboard layout you are using (for example, North American).
2. At the Display Set-up menu, select the following:
   - Interpret controls
   - Light text, dark screen
   - Cursor (visible)
3. At the General Set-up menu, select the following:
   - VT200 or VT100 mode (if VT100 mode, set VT100 ID)
   - 7-bit or 8-bit controls
   - Multinational/national
   - Normal cursor keys
   - No new line
4. At the Communications Set-up menu, select the following:
   - XOFF at 64 or XOFF at 128
   - 8-bit communication line
   - 8-bit (any) parity
   - No local echo
5. At the Keyboard Set-up menu, select warning bell ON.

At the DCL prompt, enter the following command:

     $  SET TERMINAL /INQUIRE

The software determines the terminal's characteristics and sets the appropriate parameters.

If you select National character mode, enter the following command:

    $ SET TERMINAL /NOEIGHTBIT

### 4.12.2.2 VT100-Series Terminal Setup

To set up a VT100-Series terminal for emulation, follow these steps:

1. Set your terminal to ANSI mode (see the user's guide for your terminal).
2. Enter the following command at the DCL prompt:

       $  SET TERMINAL/INQUIRE

   This command causes the terminal to be questioned about its characteristics. The appropriate parameters for the terminal are set up according to its response.

TN3270 requires Compaq terminals or DECterm windows that support at least 24 lines and 80 columns.

## 4.12.3 Starting and Exiting from TN3270

Start a TN3270 session by using the TN3270 command. You can also use the TELNET/TERMINAL_TYPE=IBM-3278-n command. The default terminal type is IBM-3278-2. The following examples show several ways to start a TN3270 session, using the TN3270 command and connecting to host CENTRAL. For more information, see Section 4.3.

- To use the default terminal type:

      $ TN3270 CENTRAL

- To use a terminal type other than the default:

      $ TN3270/TERMINAL_TYPE=IBM-3278-4 CENTRAL

You can invoke TN3270 and, without first connecting to a remote host, enter certain commands that customize the sessions and display parameters or status. You can also use a command file to invoke TN3270 and the customization.

The TN3270 command includes several qualifiers that allow you to specify customized or special files for the following:

- Character-set translation tables file (/CHARACTER_SET=file) that translates between EBCDIC and the Compaq Multinational Character Set. The default file, if set up by your system manager, is SYS$LIBRARY:TN3270DEF.TBL. If this file does not exist, and you do not specify a file, TN3270 uses its own translation table.
- Keyboard definition file (/KEY_DEFINITIONS=file) that you create as an alternative to the default keyboard layout.
- National Replacement Character Set (NRCS) file (/NATIONAL_CHARACTERS=n) for which your terminal is configured. The default for 8-bit terminals is MULTINATIONAL. The default for 7-bit terminals is US_ASCII.

You can end a TN3270 session (close the connection) in one of the following ways:

- At the remote host's system prompt, log out.
- At the remote host's system prompt, return to the TN3270 prompt and disconnect the session as follows:
  1. At the remote host's system prompt, press the TN3270 escape character (Ctrl/] is the default).
  2. At the TN3270 prompt, enter either the DISCONNECT or the `close` command.

## 4.12.4 Clearing Error Messages

TN3270 displays error messages in a bordered display at the bottom of your screen. This display overwrites the status display and remains visible until you clear it. To clear the display, invoke one of the following functions:

- REFR
- HELP
- SET FIL
- DEF KEY

## 4.12.5 Recording Sessions

During a TN3270 session, you can record your screen's contents. The PRINT function directs your screen's contents to either a file or a spooled printer.

To record your screen's contents, follow these steps:

1. Invoke the PRINT keyboard function, as described in Section 4.12.8.
   The screen display is recorded in a file in a compressed state. Null lines (lines with only nulls and attribute characters) do not appear.
2. Invoke the ENTER function or any function that transmits the screen contents to the remote host's application, as described in Section 4.12.8.

This creates the default output file, TN3270PRINT.LIS. TELNET does the following:

- Each time you start a TELNET session that runs TN3270, TELNET opens a new TN3270PRINT.LIS file.
- Each time you use PRINT during a session, TELNET appends new output from the screen to the end of TN3270PRINT.LIS.
- Each time you use PRINT, if you direct the output to a printer, TELNET creates a separate entry in the print queue.
- If the printer is spooled, TELNET immediately prints the output.

You can specify a different file name. To change the name, use one of the following methods:

- When you start a TN3270 session, use the /PRINTER qualifier, as shown in the follwing example:

      $ TN3270 [ host ] /PRINTER=file

- During a TN3270 session, follow these steps:
  1. Use the SET FIL keyboard function, as explained in Section 4.12.8.
  2. At the prompt for a new file name, enter a name.
     If you specify the same name that is already in use, subsequent PRINT operations direct output to a new version of the same file.
  3. Use the NEW LINE keyboard function, as explained in Section 4.12.8.

## 4.12.6 Online Help

Online help during a TN3270 session displays the following information:

- A picture of the keypad
- A list of TN3270 keyboard functions
- The key combinations that invoke the TN3270 keyboard functions

The Help screen shows the TN3270 functions as they correspond to the keys on your physical keyboard, as follows:

- Top-row keys
- Editing keypad
- Application keypad
- Up to 32 control or extended character definitions
- All your definitions and changes, including those you make interactively

To see the Help screen, use the HELP function key F15.

## 4.12.7 If the Keyboard Locks

If your keyboard locks, the terminal bell rings, and the status line displays the following information:

    Inhib

To unlock the keyboard, press the KP0 key to invoke the RESET function. (KP0 refers to the zero (0) key in the application keypad on the right hand side of the keyboard.)

Do not use the following functions when the cursor is in a protected field (a field that does not accept user input):

- DELETE
- DUP
- ER EOF
- FM
- Any graphic character

## 4.12.8 Keyboard Functions

This section describes the keyboard functions. Preceding each function description are the key sequences for VT100 and VT200 terminals and the function name to use in a DEFINE/KEY command. In many of the key sequences, TN3270 allows use of the extended function (EXT) feature. Used in conjunction with another key, EXT allows access to an extended function for that key. The following illustrates the extended function feature in more detail.

ATTACH

VT100: EXT + E | VT200: EXT + Find
DEFINE_KEY Function: ATTACH

Changes control from one subprocess to another subprocess or to the parent process. When you invoke the ATTACH function, TN3270 uses the name of the last process to which you attached as the default process name.

If you want to attach to a different process, press Ctrl/U to erase the default process name. You can then enter the process name of your choice at the prompt. The process name can be a quoted string. Use the quotation marks to preserve spaces, tabs, or lowercase letters in strings.

ATTN

VT100: EXT + A | VT200: F19
DEFINE_KEY Function: ATTENTION

Provides a way to "get the attention of" the remote application program that you are running by sending a SIGNAL RU command to the remote host. See the user's guide of the particular application program to learn what response the program gives when you use this key.

Back Tab (| Left arrow)

VT100: BACKSPACE | VT200: F12
DEFINE_KEY Function: BACK_TAB

Moves the cursor, depending on the type of screen. On a formatted screen, the cursor moves one of the following ways, depending on the cursor's location when you press this key:

- If the cursor is in a field, but not at the first position of the field, it moves to the beginning of the unprotected field that it is in.
- If the cursor is in the first position of a field, it moves to the beginning of the preceding unprotected field. If the cursor is in the first position of the first unprotected field, the cursor moves to the first position of the last unprotected field on the screen.

On an unformatted screen, the cursor returns to the first position on the screen.

Cent Sign (¢)

VT100: EXT + C | VT200: EXT + C
DEFINE_KEY Function: (None)

Enters a cent sign. If your terminal does not have this character, your screen displays a hyphen ( - ).

CLEAR

VT100: EXT + Enter | VT200: EXT + F20
DEFINE_KEY Function: CLEAR

Clears the screen and moves the cursor to the first position on the screen. When you invoke the CLEAR function, the software notifies the application program that this function has been used.

DEF KEY (DEFINE key)

VT100: Ctrl/K | VT200: Ctrl/K
DEFINE_KEY Function: DEFINE_KEY

Lets you interactively define or redefine a key. You get a prompt for the name of the key to define and for a function you want to assign to that key. Refer to Section 4.12.9 for more information about using the DEF KEY function.

DELETE

VT100: Delete | VT200: <X]
DEFINE_KEY Function: DELETE

Deletes the character at the cursor. The cursor remains where it is, and the other characters to the right of the cursor in the same field move one position to the left. The end of the field fills with blanks. Note that this is not the action normally associated with the Delete key on Compaq keyboards.

DSP ATT (display attributes)

VT100: Ctrl/V | VT200: EXT + F17
DEFINE_KEY Function: DISPLAY_ATTRIBUTES

Enables and disables the visible attribute mode. This mode of operation forces display of the attribute characters (that is, the characters at the start of a field that indicate the display and data type of that field). In IBM 3270 model terminal emulation (TN3270), you can use the DSP ATT function to debug application programs, as explained in Section 4.12.10.

Previous | Next | Contents | Index