DIGITAL TCP/IP Services for OpenVMS
User's Guide


Previous Contents Index

4.1 Typing TELNET/TN3270 Commands

Use the following rules when you enter a TELNET command line.

4.1.1 DCL and UNIX Command Formats

With the TELNET command and most of the commands at the TELNET prompt, you can use either DCL-style or UNIX style syntax. For example, the following two commands produce the same results:


$ TELNET 
TELNET> SHOW PARAMETERS 


$ TELNET 
TELNET> DISPLAY 

4.1.2 Quotation Marks

No quotation marks are required for typing:

The following example connects to UNIX host migain and sets a terminal type with the /TERMINAL_TYPE qualifier. No quotation marks are needed to pass a terminal type to migain in lowercase, as demonstrated with the remote host's printenv command.


$ TELNET MIGAIN /TERMINAL_TYPE=vt300 
%TELNET-I-Trying, Trying ...11.90.208.56 
%TELNET-I-SESSION, Session 01, host migain, port 23 
-TELNET-I-Escape, Escape character is '^]' 
 
Hello from UNIX host migain 
 
login: root 
Password:...
   .
   .
   .
migain# printenv 
TERM=vt300 
HOME=/ 
SHELL=/bin/csh 
USER=root 
PATH=/bin:/usr/bin:/usr/ucb:/etc:/usr/etc:. 
LOGNAME=root 
PWD=/ 
migain# 

4.2 Obtaining Online Help

You can obtain online help for the TELNET and TN3270 services by entering any of the following commands:


$ HELP TELNET
$ HELP TN3270
$ HELP TCPIP_SERVICES TELNET
 

You can also enter the HELP command at the TELNET prompt:


TELNET> HELP

4.3 Starting TELNET and TN3270

You can start a TELNET or TN3270 session with a remote host (also called establishing a connection and opening a connection) in one of the following ways:

The following example shows three ways to establish a connection interactively:


$ TELNET CENTRAL /TERMINAL_TYPE=IBM-3278-2 
 
 
$ TELNET 
TELNET> CONNECT CENTRAL 23 VT200
 
 
$ TN3270 CENTRAL /TERMINAL_TYPE=IBM-3278-3 

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


$ TELNET 
TELNET> SHOW STATUS 
%TELNET-E-NOSESSION, No active session 
Escape character: '^]' 
TELNET>SET DEVICE TERMINAL=VT300 
TELNET> OPEN GALAXY 
%TELNET-I-TRYING, Trying ... 1.20.208.10 
%TELNET-I-SESSION, Session 01, host galaxy, port 23 
-TELNET-I-ESCAPE, Escape character is ^] 
 
Digital UNIX (galaxy.udb.com) (ttyp5) 
 
login: 

4.4 Exiting TELNET and TN3270

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

The following example shows two ways to close connections:


% logout 
%TELNET-S-REMCLOSED, Remote connection closed 
-TELNET-I-SESSION, Session 01, host galaxy, port 23 
TELNET> 
 
TELNET> EXIT 
$ 
 
 
% [Ctrl/]]          (characters not echoed) 
TELNET> DISCONNECT 
galaxy.udp.com> 
TELNET> DISCONNECT 
%TELNET-S-LCLCLOSED, Local connection closed 
-TELNET-I-SESSION, Session 01, host galaxy, port 23 
TELNET>

4.5 Keeping a Log of Your TELNET Session

To keep a log of your TELNET session, use the /LOG_FILE qualifier. (You cannot use this qualifier with a TN3270 session.)

The following example establishes a TELNET connection to node central, sets the terminal type to VT200, and logs all session output to the file CENT.LOG in your current directory.


$  TELNET/LOG_FILE=CENT.LOG/TERMINAL_TYPE=VT200 CENTRAL

4.6 Command Procedures

With DCL command files, you can start TELNET and TN3270 sessions (see Section 4.6.1) and customize the TELNET/TN3270 environment (see Section 4.6.2).

4.6.1 Starting TELNET/TN3270

You can create a command procedure containing the DCL DEFINE and TELNET (or TN3270) commands.

The following example shows an example of a TELNET command procedure.


$! My TELNET startup command file, START_TELNET.COM. 
$! 
$! This command procedure establishes a TELNET session 
$! with UNIX host central. 
$! 
$ DEFINE /USER_MODE SYS$INPUT TT: 
$ TELNET CENTRAL 

4.6.2 Initialization Command Files

You can create initialization command files to customize your TELNET/TN3270 sessions with SET, ENABLE, and DISABLE commands. These command files:

The following example shows a TELNET initialization command procedure.


! This file, TELNETINIT.INI, sets my TELNET parameters 
! the way I like them. 
! 
DISABLE AUTOFLUSH 
ENABLE BINARY 
ENABLE DEBUG 
SET DEVICE /TERMINAL=VT300 
SET ESCAPE "^p" 

4.7 Toggling Between the Remote Host and Local TELNET/TN3270

During a session with a remote host, you can toggle back and forth between the local TELNET or TN3270 process and the connected host. For example, at the TELNET prompt, you might want to display status, modify a TELNET parameter, or spawn a DCL subprocess.

The following example toggles between remote UNIX host biway and the local OpenVMS system.


biway> [Ctrl/]]  (characters not echoed) 
TELNET> SHOW STATUS 
Session  1 Active  Host biway Port 23 
    Operating Mode: Character-at-a-time 
    Escape character: '^]' 
    Options: 
       Echo - Remote 
       Terminal Type - Local 
       Terminal Type - VT300 
       Suppress Go Ahead - Local 
       Suppress Go Ahead - Remote 
    Terminal Dataoveruns:    0 
    Suspended Network I/Os:  0 
              
   .
   .
   .
TELNET> [Return] 
biway>

In the next example, user BENTLEY, working at OpenVMS node EAGLE, uses TELNET to do the following:

  1. Establish a connection to UNIX host fern.
  2. Return to the local TELNET prompt.
  3. Display status.
  4. Establish a connection to host gannet.
  5. Return to the TELNET prompt.
  6. Display status.
  7. Connect to sands. But, sands closes the connection because BENTLEY incorrectly enters the password three times.
  8. Try to resume the session with gannet. However, RESUME without specifying a session number fails:


$ TELNET FERN 
   .
   .
   .
fern> [Ctrl/]]        (characters not echoed) 
 
TELNET> SHOW STATUS  
Session  1 Active  Host FERN 
   .
   .
   .
TELNET> CONNECT GANNET 
   .
   .
   .
gannet> [Ctrl/]] (characters not echoed) 
TELNET> SHOW STATUS 
Session  2 Active  Host GANNET 
    Operating Mode: Character-at-a-time 
    Escape character: '^]'
   .
   .
   .
Session  1 Waiting Host FERN 
 
TELNET> CONNECT SANDS 
%TELNET-I-Trying, Trying...11.18.222.95 
%TELNET-I-SESSION, Session 03, host sands, port 23 
-TELNET-I-Escape, Escape character is '^]'.
   .
   .
   .
      Sun Microsystems, Inc. UNIX System sands - Authorized Access Only 
 
Username: BENTLEY 
Password: 
User authorization failure 
Username: BENTLEY 
Password: 
User authorization failure 
Username: BENTLEY 
Password: 
User authorization failure 
 
Remote connection closed 
 
TELNET> RESUME 
No current session 
TELNET> SHOW STATUS 
Session  1 Waiting Host FERN 
Session  2 Waiting Host GANNET
   .
   .
   .
TELNET> RESUME 2 
 
gannet> [Ctrl/]]          (characters not echoed) 
TELNET> SHOW STATUS 
Session  2 Active  Host GANNET 
    Operating Mode: Character-at-a-time 
    Escape character: '^]'
   .
   .
   .
Session  1 Waiting Host FERN 
TELNET>

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.


TELNET> SPAWN
$ DIR
   .
   .
   .
$ DEL TR3.TXT:*

4.9 Multiple Sessions

TELNET supports:

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

Table 4-2 TELNET SHOW STATUS Display: Terminology
Term Meaning
Active host Host from which you typed the escape sequence to return to the TELNET prompt.
Current session If you log out of the active host at its system prompt, or issue the TELNET DISCONNECT command, no current session exists.

To resume a connection, even if only one exists, issue:
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, issue:
TELNET> RESUME
n

To open another TELNET connection:

  1. At the system prompt of the remote host, press 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 from one open TELNET connection to another:

  1. Enter the TELNET escape sequence.
  2. If necessary, issue SHOW STATUS to check the number of your session with the other host.
  3. Issue 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 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, issue ENABLE, DISABLE, and SET commands. You can modify how TELNET and TN3270:

You can redefine the following control characters, such as when your terminal or the remote host does not recognize the corresponding default control character.

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. Or, you can redefine a key interactively, 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:

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 in 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 character (EOL) 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 if 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 as the flush output character.
Determine if your connection with the remote host is still established, the remote host replying 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.


Previous Next Contents Index