s3270(1)

NAME

s3270 - IBM host access tool

SYNOPSIS

s3270 [options] [host]

DESCRIPTION

s3270 opens a telnet connection to an IBM host, then al
lows a script to control the host login session. It is derived
from x3270(1), an X-windows IBM 3270 emulator. 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.
Prepending an L: onto hostname causes s3270 to first cre
ate an SSL tunnel to the host, and then create a TN3270 session
inside the tunnel. (This function is supported only if s3270 was
built with SSL/TLS support). Note that TLS-encrypted sessions
using the TELNET START-TLS option are negotiated with the host
automatically; for these sessions the L: prefix should not be
used.
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.
The hostname may optionally be placed inside square-brack
et characters `[' and `]'. This will prevent any colon `:' char
acters in the hostname from being interpreted as indicating op
tion prefixes or port numbers. This allows numeric IPv6 address
es to be used as hostnames.
On systems that support the forkpty library call, the
hostname may be replaced with -e and a command string. This will
cause s3270 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 ver
sions of s3270 and with tn3270(1), the port may also be specified
as a second, separate argument.)

OPTIONS

s3270 understands the following options:
-charset name
Specifies an EBCDIC host character set. See CHAR
ACTER SETS below.
-clear toggle
Sets the initial value of toggle to false. The
list of toggle names is under TOGGLES below.
-im method
Specifies the name of the input method to use for
multi-byte input. (Supported only when s3270 is compiled with
DBCS support.)
-km name
Specifies the local encoding method for multi-byte
text. name is an encoding name recognized by the ICU library.
(Supported only when s3270 is compiled with DBCS support, and
necessary only when s3270 cannot figure it out from the locale.)
-model name
The model of 3270 display to be emulated. The mod
el name is in two parts, either 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 speci
fies the number of rows and columns. Model 4 is the default.
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 default model is 3278-4.
-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 (controlled by the "s3270.ex
tended" resource), 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-E, for
example, IBM-3278-4-E.
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, or setting the
"s3270.extended" resource to "false", removes the -E from the
terminal name when connecting to such hosts.
The name can also be specified with the
"s3270.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.
-tracefilesize size
Places a limit on the size of a trace file. If
this option is not specified, or is specified as 0 or none, the
trace file will be unlimited. If specified, the trace file can
not already exist, and the (silently enforced) minimum size is 64
Kbytes. The value of size can have a K or M suffix, indicating
kilobytes or megabytes respectively.
-xrm "s3270.resource: value"
Sets the value of the named resource to value. Re
sources control less common s3270 options, and are defined under
RESOURCES below.

CHARACTER SETS

The -charset option or the "s3270.charset" resource con
trols the EBCDIC host character set used by s3270. Available
sets include:
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.

NVT (ANSI) MODE

Some hosts use an ASCII front-end to do initial login ne
gotiation, then later switch to 3270 mode. s3270 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, s3270 will return to ANSI emulation.
In NVT mode, s3270 supports both character-at-a-time mode
and line mode operation. You may select the mode with a menu op
tion. When in line mode, the special characters and operational
characteristics are defined by resources:

TOGGLES

s3270 has a number of configurable modes which may be se
lected by the -set and -clear options.
monoCase
If set, s3270 operates in uppercase-only mode.
blankFill
If set, s3270 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, elimi
nating 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:
These names are also used as the first parameter to the

Toggle

ACTIONS

Here is a complete list of basic s3270 actions. Script
specific actions are described on the x3270-script(1) manual
page.
Actions marked with an asterisk (*) may block, sending da
ta to the host and possibly waiting for a response.

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.
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
BufferSize No 4096
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

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

host. add adds Newline characters to each host file record before transferring it to the local workstation. keep preserves

Newline

Exist Controls what happens when the destination file al
ready exists. keep (the default) preserves the file, causing the

Transfer

with the source file. append appends the source file to the destination file.
Recfm Controls the record 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

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.
BufferSize
Buffer size for DFT-mode transfers. Can range from
256 to 32768. Larger values give better performance, but some
hosts may not be able to support them.

NESTED SCRIPTS

There are several types of nested script functions avail
able.
The String Action
The simplest method for nested scripts 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, s3270
will wait for the host to unlock the keyboard before further pro
cessing the string.)

Left
Clear*
Enter*
an PA(n)*
fnn PF(nn)* Newline

Tab
T BackTab
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 ac
tion, 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 repre
sent ASCII characters, which are sent directly to the host.
The Script Action
This action causes s3270 to start a child process
which can execute s3270 actions. Standard input and output from
the child process are piped back to s3270. The Script action is
fully documented in x3270-script(1).

PASSTHRU

s3270 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 host
name, s3270 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 s3270 options can be configured via resources.
Resources are defined by -xrm options. The definitions are simi
lar to X11 resources, and use a similar syntax. The resources
available in s3270 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
dsTrace False -trace Data stream
tracing
eof ^D NVT-mode EOF
character
erase ^H NVT-mode erase
character
extended True Use 3270 extend
ed data stream
eventTrace False -trace Event tracing
ftCommand ind$file Host file trans
fer command
icrnl False Map CR to NL on
NVT-mode input
inlcr False Map NL to CR in
NVT-mode input
intr ^C NVT-mode inter
rupt character
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) em
ulation
monoCase False -set monoCase Mono-case mode
numericLock False Lock keyboard
for numeric field error
oerrLock False Lock keyboard
for input error
oversize -oversize Oversize screen
dimensions
port telnet -port Non-default TCP
port
quit ^ NVT-mode quit
character
rprnt ^R NVT-mode reprint
character
secure False Disable "danger
ous" options
termName (note 2) -tn TELNET terminal
type string
traceDir /tmp Directory for
trace files
traceFile (note 3) -tracefile File for trace
output
werase ^W NVT-mode word
erase character

Note 1: m3279 defaults to False. It can be forced
to True with the -model option.
Note 2: The default terminal type string is con
structed from the model number, color emulation, and extended da
ta 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.
If more than one -xrm option is given for the same re
source, the last one on the command line is used.

FILES

/usr/local/lib/x3270/ibm_hosts

SEE ALSO

x3270(1), c3270(1), tcl3270(1), ibm_hosts(5),
x3270-script(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 Selec
tion
RFC 2355, TN3270 Enhancements

COPYRIGHTS

Modifications Copyright 1993, 1994, 1995, 1996, 1997,
1999, 2000, 2001, 2002, 2004 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, At
lanta, GA 30332.
All Rights Reserved. GTRC hereby grants public use
of this software. Derivative works based on this software must
incorporate this copyright notice.
s3270 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
file LICENSE for more details.

VERSION

s3270 3.3.4
09 April 2005
Copyright © 2010-2025 Platon Technologies, s.r.o.           Index | Man stránky | tLDP | Dokumenty | Utilitky | O projekte
Design by styleshout