c3270 Manual Page

Contents

Name
Synopsis
Description
Options
Character Sets
Hosts Database
NVT (ANSI) Mode
Toggles
Status Line
Actions
Keymaps
File Transfer
Scripts
Composite Characters
Printer Support
Passthru
Resources
Files
See Also
Copyrights
Version

Name

c3270 - curses-based IBM host access tool

Synopsis

c3270 [options] [host]

Description

c3270 opens a telnet connection to an IBM host in a console window. It implements RFCs 2355 (TN3270E), 1576 (TN3270) and 1646 (LU name selection), and supports IND$FILE file transfer.

The full syntax for host is:

[prefix:]...[LUname@]hostname[:port]

Prepending a p: onto hostname causes the connection to go through the telnet-passthru service rather than directly to the host. See PASSTHRU below.

Prepending an s: onto hostname removes the "extended data stream" option reported to the host. See -tn below for further information.

Prepending an n: onto hostname turns off TN3270E support for the session.

A specific LU name to use may be specified by prepending it to the hostname with an `@'. Multiple LU names to try can be separated by commas. An empty LU can be placed in the list with an extra comma.

On systems that support the forkpty library call, the hostname may be replaced with -e and a command string. This will cause c3270 to connect to a local child process, such as a shell.

The port to connect to defaults to telnet. This can be overridden with the -port option, or by appending a port to the hostname with a colon `:'. (For compatability with previous versions of c3270 and with tn3270(1), the port may also be specified as a second, separate argument.)

Options

c3270 understands the following options:
-charset name
Specifies an EBCDIC national character set. See CHARACTER SETS below.
-clear toggle
Sets the initial value of toggle to false. The list of toggle names is under TOGGLES below.
-hostsfile file
Uses file as the hosts file, which allows aliases for host names and scripts to be executed at login. See ibm_hosts(1) for details.
-keymap name
Specifies a keyboard map to be found in the resource c3270.keymap.name or the file name. See KEYMAPS below for details.
-model name
The model of 3270 display to be emulated. The model name is in three parts, any of which may be omitted:

The first part is the base model, which is either 3278 or 3279. 3278 specifies a monochrome 3270 display; 3279 specifies a color 3270 display.

The second part is the model number, which specifies the number of rows and columns. Model 4 is the default.

Model Number
Columns
Rows
2
80
24
3
80
30
4
80
43
5
132
27

Note: Technically, there is no such 3270 display as a 3279-4 or 3279-5, but most hosts seem to work with them anyway.

The third part specifies the Extended 3270 Data Stream, and is given as -E. It signals the host that the 3270 display is capable of displaying extended field attributes, and supports structured fields and query replies. A 3279 always uses the Extended Data Stream (whether or not -E is specified); for a 3278 it is optional.

The default model for a color display is 3279-4-E. For a monochrome display, it is 3278-4-E.

-mono
Forces 3278 emulation.
-oversize colsxrows
Makes the screen larger than the default for the chosen model number. This option has effect only in combination with extended data stream support (the -E suffix on the model), and only if the host supports the Query Reply structured field. The number of columns multiplied by the number of rows must not exceed 16383 (3fff hex), the limit of 14-bit 3270 buffer addressing.
-port n
Specifies a different TCP port to connect to. n can be a name from /etc/services like telnet, or a number. This option changes the default port number used for all connections. (The positional parameter affects only the initial connection.)
-set toggle
Sets the initial value of toggle to true. The list of toggle names is under TOGGLES below.
-tn name
Specifies the terminal name to be transmitted over the telnet connection. The default name is IBM-model_name, for example, IBM-3279-4-E for a color display, or IBM-3278-4-E for a monochrome display.

Some hosts are confused by the -E suffix on the terminal name, and will ignore the extra screen area on models 3, 4 and 5. Prepending an :s on the hostname removes the -E from the terminal name when connecting to such hosts.

The name can also be specified with the "c3270.termName" resource.

-trace
Turns on data stream and event tracing at startup. The default trace file name is /tmp/x3trc.process_id.
-tracefile file
Specifies a file to save data stream and event traces into, overriding the default of /tmp/x3trc.process_id.
-xrm "c3270.resource: value"
Sets the value of the named resource to value. Resources control less common c3270 options, and are defined under RESOURCES below.

Character Sets

The -charset option or the "c3270.charset" resource controls the EBCDIC national character set used by c3270. Available sets include:

Charset Name
Q121 Code
bracket
-
us-intl
01
german
03
finnish
09
uk
22
norwegian
23
french
30
icelandic
-
belgian
-
italian
-

The default character set is bracket, which is useful for common IBM hosts which use EBCDIC codes 0xAD and 0xBD for the `[' and `]' characters, respectively.

Hosts Database

c3270 uses the ibm_hosts database to define aliases for host names, and to specify macros to be executed when a connection is first made. See ibm_hosts(5) for details.

You may specify a different ibm_hosts database with the "c3270.hostsFile" resource.

NVT (ANSI) Mode

Some hosts use an ASCII front-end to do initial login negotiation, then later switch to 3270 mode. c3270 will emulate an ANSI X.64 terminal until the host places it in 3270 mode (telnet BINARY and SEND EOR modes, or TN3270E mode negotiation).

If the host later negotiates to stop functioning in 3270 mode, c3270 will return to ANSI emulation.

In NVT mode, c3270 supports both character-at-a-time mode and line mode operation. You may select the mode with a menu option. When in line mode, the special characters and operational characteristics are defined by resources:

Mode/Character Resource Default
Translate CR to NL c3270.icrnl true
Translate NL to CR c3270.inlcr false
Erase previous character c3270.erase ^?
Erase entire line c3270.kill ^U
Erase previous word c3270.werase ^W
Redisplay line c3270.rprnt ^R
Ignore special meaning of next character c3270.lnext ^V
Interrupt c3270.intr ^C
Quit c3270.quit ^\
End of file c3270.eof ^D

A separate keymap can be defined for use only when c3270 is in NVT mode. See KEYMAPS for details.

Toggles

c3270 has a number of configurable modes which may be selected by the -set and -clear options.
monoCase
If set, c3270 operates in uppercase-only mode.
blankFill
If set, c3270 behaves in some un-3270-like ways. First, when a character is typed into a field, all nulls in the field to the left of that character are changed to blanks. This eliminates a common 3270 data-entry surprise. Second, in insert mode, trailing blanks in a field are treated like nulls, eliminating the annoying `lock-up' that often occurs when inserting into an field with (apparent) space at the end.
lineWrap
If set, the ANSI terminal emulator automatically assumes a NEWLINE character when it reaches the end of a line.

The names of the toggles for use with the -set and -clear options are as follows:

Option Name
Monocase monoCase
Blank Fill blankFill
Track Cursor cursorPos
Trace Data Stream dsTrace
Trace Events eventTrace
Save Screen(s) in File screenTrace
Wraparound lineWrap

Status Line

The c3270 status line contains a variety of information. From left to right, the fields are:
comm status
Three symbols indicate the state of the connection to the host. If connected, the right-hand symbol is a solid box; if not, it is a question mark.
keyboard lock
If the keyboard is locked, an "X" symbol and a message field indicate the reason for the keyboard lock.
typeahead
The letter "T" indicates that one or more keystrokes are in the typeahead buffer.
temporary keymap
The letter "K" indicates that a temporary keymap is in effect.
reverse
The letter "R" indicates that the keyboard is in reverse field entry mode.
insert mode
The letter "I" indicates that the keyboard is in insert mode.
cursor position
The cursor row and column are optionally displayed, separated by a "/".

Actions

Here is a complete list of basic c3270 actions. Script-specific actions are described on the x3270-script(1) manual page.

Attn attention key
BackSpace move cursor left (or send ASCII BS)
BackTab tab to start of previous input field
CircumNot input "^" in NVT mode, or "¬" in 3270 mode
Clear clear screen
Compose next two keys form a special symbol
Connect(host) connect to host
CursorSelect Cursor Select AID
Delete delete character under cursor (or send ASCII DEL)
DeleteField delete the entire field
DeleteWord delete the current or previous word
Disconnect disconnect from host
Down move cursor down
Dup duplicate field
Enter Enter AID (or send ASCII CR)
Erase erase previous character (or send ASCII BS)
EraseEOF erase to end of current field
EraseInput erase all input fields
Escape escape to c3270> prompt
Execute(cmd) execute a command in a shell
FieldEnd move cursor to end of field
FieldExit clear to end of field and skip to next (5250 emulation)
FieldMark mark field
HexString(hex_digits) insert control-character string
Home move cursor to first input field
Insert set insert mode
Interrupt send TELNET IP to host
Key(keysym) insert key keysym
Key(0xxx) insert key with ASCII code xx
Left move cursor left
Left2 move cursor left 2 positions
MonoCase toggle uppercase-only mode
MoveCursor(row,col) move cursor to (row,col)
Newline move cursor to first field on next line (or send ASCII LF)
NextWord move cursor to next word
PA(n) Program Attention AID (n from 1 to 3)
PF(n) Program Function AID (n from 1 to 24)
PreviousWord move cursor to previous word
Printer(Start[,lu]|Stop) Start or stop printer session
PrintText(command) print screen text on printer
PrintWindow(command) print screen image (bitmap) on printer
Quit exit c3270
Redraw redraw window
Reset reset locked keyboard
Right move cursor right
Right2 move cursor right 2 positions
Script(command[,arg...]) run a script
String(string) insert string (simple macro facility)
SysReq System Request AID
Tab move cursor to next input field
ToggleInsert toggle insert mode
ToggleReverse toggle reverse-input mode
Transfer(option=value...) file transfer
Up move cursor up
ignore do nothing

Any of the above actions may be entered at the c3270> prompt; these commands are also available for use in keymaps (see KEYMAPS). Command names are case-insensitive. Parameters can be specified with parentheses and commas, e.g.:

PF(1)
or with spaces, e.g.:
PF 1
Parameters can be quoted with double-quote characters, to allow spaces, commas, and parentheses to be used.

c3270 also supports the following interactive commands:

Help
Displays a list of available commands.
Show
Displays statistics and settings.
Trace
Turns tracing on or off. The command trace on enables data stream and keyboard event tracing; the command trace off disables it. The qualifier data or keyboard can be specified before on or off to enable or disable a particular trace. After on, a filename may be specified to override the default trace file name of /tmp/x3trc.pid.

Keymaps

The -keymap option allows a keymap to be specified. If the option -keymap xxx is given, then c3270 will first look for a resource named c3270.keymap.xxx; if that is not found, then it will look for a file named xxx.

Multiple keymaps may be specified be separating their names with commas. Definitions in later keymaps supercede those in earlier keymaps.

In addition, separate keymaps may be defined that apply only in NVT mode. For example, the resource definition c3270.keymap.xxx.nvt will override the definition of c3270.keymap.xxx, when c3270 is in NVT mode. Similarly, the keymap in the file xxx.nvt will override the keymap in the file xxx, when c3270 is in NVT mode.

Keymaps specify actions to perform when a particular sequence of keys is pressed. Each line in a keymap has the following syntax:

[Meta][Ctrl]<Key>key...: Action[(param[,...])] ...

For example:

Meta<Key>c: Clear()
<Key>PPAGE: PF(7)
Ctrl<Key>A <Key>F1: PF(13)

The optional Meta or Ctrl qualifiers specify that the Meta and Ctrl keys are pressed along with the specified key, respectively. The key is either a valid X11 keysym (these are the ISO 8859-1 symbol names, such as equal for `=' and a for `a') or a valid ncurses key name, such as UP. The Action is an action from the ACTIONS list, above. More than one action may be specified.

Keymap entries are case-sensitive and modifier-specific. This means that a keymap for the b key will match only a lowercase b. Actions for uppercase B, or for Meta-b or Control-B, must be specified separately.

The base keymap is:

Key Action
<Key>Escape Escape
Meta<Key>c Clear
Ctrl<Key>a <Key>c Clear
Meta<Key>r Reset
Ctrl<Key>a <Key>r Reset
Meta<Key>l Redraw
Ctrl<Key>a <Key>l Redraw
Meta<Key>m Compose
Ctrl<Key>a <Key>m Compose
<Key>Tab Tab
Ctrl<Key>a <Key>Tab BackTab
Meta<Key>^ Key(notsign)
<Key>DC Delete
<Key>BACKSPACE BackSpace
<Key>BackSpace BackSpace
<Key>Return Enter
<Key>Linefeed Newline
<Key>UP Up
<Key>DOWN Down
<Key>LEFT Left
<Key>RIGHT Right
<Key>F(n) PF(n)
Ctrl<Key>a <Key>F(n) PF(n+12)
Meta<Key>1 PA(1)
Ctrl<Key>a <Key>1 PA(1)
Meta<Key>2 PA(2)
Ctrl<Key>a <Key>2 PA(2)
Meta<Key>3 PA(3)
Ctrl<Key>a <Key>3 PA(3)

For keyboards which do not have a Meta key, there is an additional keymap defined, called nometa. (On some systems, this is added by default.) The nometa keymap uses the Escape key as a substitute for the Meta key. So, for example, the 3270 PA1 action would be invoked by pressing the Escape key, then the 1 key.

File Transfer

The Transfer action implements IND$FILE file transfer. This action requires that the IND$FILE program be installed on the IBM host, and that the 3270 cursor be located in a field that will accept a TSO or VM/CMS command. .LP Because of the complexity and number of options for file transfer, the parameters to the Transfer action take the unique form of option=value, and can appear in any order. The options are:

Option Required? Default Other Values
Direction No send receive
HostFile Yes    
LocalFile Yes    
Host No tso vm
Mode No ascii binary
Cr No remove add, keep
Exist No keep replace, append
Recfm No   fixed, variable, undefined
Lrecl No    
Blksize No    
Allocation No   tracks, cylinders, avblock
PrimarySpace No    
SecondarySpace No    

The option details are as follows.

Direction
send (the default) to send a file to the host, receive to receive a file from the host.
HostFile
The name of the file on the host.
LocalFile
The name of the file on the local workstation.
Host
The type of host (which dictates the form of the IND$FILE command): tso (the default) or vm.
Mode
Use ascii (the default) for a text file, which will be translated between EBCDIC and ASCII as necessary. Use binary for non-text files.
Cr
Controls how Newline characters are handled when transferring Mode=ascii files. remove (the default) strips Newline characters in local files before transferring them to the host. add adds Newline characters to each host file record before transferring it to the local workstation. keep preserves Newline characters when transferring a local file to the host.
Exist
Controls what happens when the destination file already exists. keep (the default) preserves the file, causing the Transfer action to fail. replace overwrites the destination file with the source file. append appends the source file to the destination file.
Recfm
Controls the record format of files created on the host. fixed creates a file with fixed-length records. variable creates a file with variable-length records. undefined creates a file with undefined-length records (TSO hosts only). The Lrecl option controls the record length or maximum record length for Recfm=fixed and Recfm=variable files, respectively.
Lrecl
Specifies the record length (or maximum record length) for files created on the host.
Blksize
Specifies the block size for files created on the host. (TSO hosts only.)
Allocation
Specifies the units for the TSO host PrimarySpace and SecondarySpace options: tracks, cylinders or avblock.
PrimarySpace
Primary allocation for a file created on a TSO host. The units are given by the Allocation option.
SecondarySpace
Secondary allocation for a file created on a TSO host. The units are given by the Allocation option.

Scripts

There are several types of script functions available.
The String Action
The simplest method for scripting is provided via the String action. The arguments to String are one or more double-quoted strings which are inserted directly as if typed. The C backslash conventions are honored as follows. (Entries marked * mean that after sending the AID code to the host, c3270 will wait for the host to unlock the keyboard before further processing the string.)
\b Left
\f Clear*
\n Enter*
\pan PA key n*
\pfnn PF key nn*
\r Newline
\t Tab

An example keymap entry would be:

Meta<Key>p: String("probs clearrdr\n")

Note: The strings are in ASCII and converted to EBCDIC, so beware of inserting control codes.

There is also an alternate form of the String action, HexString, which is used to enter non-printing data. The argument to HexString is a string of hexadecimal digits, two per character. A leading 0x or 0X is optional. In 3270 mode, the hexadecimal data represent EBCDIC characters, which are entered into the current field. In NVT mode, the hexadecimal data represent ASCII characters, which are sent directly to the host.

The Script Action
This action causes c3270 to start a child process which can execute c3270 actions. Standard input and output from the child process are piped back to c3270. The Script action is fully documented in x3270-script(1).

Composite Characters

c3270 allows the direct entry of accented letters and special symbols. Pressing and releasing the "Compose" key, followed by two other keys, causes entry of the symbol combining those two keys. For example, "Compose" followed by the "C" key and the "," (comma) key, enters the "C-cedilla" symbol. A C on the status line indicates a pending composite character.

The mappings between these pairs of ordinary keys and the symbols they represent is controlled by the "c3270.composeMap" resource; it gives the name of the map to use. The maps themselves are named "c3270.composeMap.name". The default is "latin1", which gives mappings for most of the symbols in the ISO 8859-1 Latin-1 character set that are not in the 7-bit ASCII character set.

Note: The default keymap defines Meta<Key>m as the "Compose" key. You may set up your own "Compose" key with a keymap that maps some other keysym onto the Compose action.

Printer Support

c3270 supports associated printer sessions via the pr3287(1) program. The Printer action is used to start or stop a pr3287 session.

The action Printer Start starts a printer session, associated with the current LU. (This works only if the host supports TN3270E.)

The action Printer Start lu starts a printer session, associated with a specific lu.

The action Printer Stop stops a printer session.

The resource c3270.printer.command specifies the command used to print each job; it defaults to lpr. The resource c3270.printer.assocCommandLine specifies the command used to start an associated printer session. It defaults to:

pr3287 -assoc %L% -command "%C%" %H%

The resource c3270.printer.luCommandLine specifies the command used to start a specific-LU printer session. It defaults to:

pr3287 -command "%C%" %L%@%H%

When the printer session command is run, the following substitutions are made:

Token Substitition
%C% Command (value of c3270.printer.command)
%H% Host IP address
%L% Current or specified LU

See pr3287(1) for further details.

Passthru

c3270 supports the Sun telnet-passthru service provided by the in.telnet-gw server. This allows outbound telnet connections through a firewall machine. When a p: is prepended to a hostname, c3270 acts much like the itelnet(1) command. It contacts the machine named internet-gateway at the port defined in /etc/services as telnet-passthru (which defaults to 3514). It then passes the requested hostname and port to the in.telnet-gw server.

Resources

Certain c3270 options can be configured via resources. Resources are defined in the file .c3270pro in the user's home directory, and by -xrm options. The definitions are similar to X11 resources, and use a similar syntax. The resources available in c3270 are:

Resource Default Option Purpose
blankFill False -set blankFill Blank Fill mode
charset bracket -charset EBCDIC character set
charset.foo     Definition of character set foo
composeMap latin1   Name of composed-character map
dsTrace False -trace Data stream tracing
eof ^D   NVT-mode EOF character
erase ^H   NVT-mode erase character
extended True   Use 3270 extended data stream
eventTrace False -trace Event tracing
ftCommand ind$file   Host file transfer command
hostsFile   -hostsfile Host alias/macro file
icrnl False   Map CR to NL on NVT-mode input
inlcr False   Map NL to CR in NVT-mode input
intr ^C   NVT-mode interrupt character
keymap   -keymap Keyboard map name
keymap.foo     Definition of keymap foo
kill ^U   NVT-mode kill character
lineWrap False -set lineWrap NVT line wrap mode
lnext ^V   NVT-mode lnext character
m3279 (note 1) -mono 3279 (color) emulation
monoCase False -set monoCase Mono-case mode
numericLock False   Lock keyboard for numeric field error
oerrLock True   Lock keyboard for input error
oversize   -oversize Oversize screen dimensions
port telnet -port Non-default TCP port
printer.* (note 4)   Printer session config
quit ^\   NVT-mode quit character
rprnt ^R   NVT-mode reprint character
secure False   Disable "dangerous" options
termName (note 2) -tn TELNET terminal type string
traceDir /tmp   Directory for trace files
traceFile (note 3) \-tracefile File for trace output
typeahead True   Allow typeahead
werase ^W   NVT-mode word-erase character

Note 1: m3279 defaults to True if the terminal supports color, False otherwise. It can be forced to False with the -mono option.

Note 2: The default terminal type string is constructed from the model number, color emulation, and extended data stream modes. E.g., a model 2 with color emulation and the extended data stream option would be sent as IBM-3279-2-E. Note also that when TN3270E mode is used, the terminal type is always sent as some type of 3278.

Note 3: The default trace file is x3trc.pid in the directory specified by the traceDir resource.

Note 4: See PRINTER SUPPORT for details.

In .c3270pro, lines are continued with a backslash character.

-xrm options override definitions found in .c3270pro. If more than one -xrm option is given for the same resource, the last one on the command line is used.

Files

/usr/local/lib/x3270/ibm_hosts
$HOME/.c3270pro

See Also

x3270(1), s3270(1), tcl3270(1), ibm_hosts(5), x3270-script(1), pr3287(1), telnet(1), tn3270(1)
Data Stream Programmer's Reference, IBM GA23-0059
Character Set Reference, IBM GA27-3831
RFC 1576, TN3270 Current Practices
RFC 1646, TN3270 Extensions for LUname and Printer Selection
RFC 2355, TN3270 Enhancements

Copyrights

Modifications Copyright © 1993, 1994, 1995, 1996, 1997, 1999, 2000 by Paul Mattes.
Original X11 Port Copyright © 1990 by Jeff Sparkes.

Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation.
Copyright © 1989 by Georgia Tech Research Corporation, Atlanta, GA 30332.
All Rights Reserved. GTRC hereby grants public use of this software. Derivative works based on this software must incorporate this copyright notice.
5250 Emulation Code Copyright © Minolta (Schweiz) AG, Beat Rubischon.

Version

c3270 3.2.16
This HTML document and the accompanying troff document were generated with a set of write-only m4 macros and the powerful vi editor.
Last modified 28 February 2001.