Using the 3270 terminal
The 3270 terminal operates a little differently from command line interfaces you may be used to on Unix or Windows. This article will go over the basics of using the 3270 (via an emulator) and how the device is supported in MTS.
Line mode
One of the most important differences is that normally the terminal operates in line mode - the host system will not receive any input until you send the line by pressing Enter
.
A very small number of programs on MTS support binary mode, where each key is processed as it is pressed - an example is the editor in visual mode. (Update: see Jeff Ogden’s comment below for a more precise description of how the terminal interacts with the operating system.)
Special keys
As well as the regular alphanumerical keys the 3270 has a number of special keys used by MTS. On an emulated terminal there is normally a way to bring up a keypad with these keys - above is the keypad on the x3270 emulator. Depending on the emulator there are also keyboard shortcuts, eg Alt-C
invokes Clear
on x3270.
PA1
sends an attention interrupt that will normally make a program stop what it is doing, similar toCtrl-C
on Unix/DOS.PA2
sends an end of file or cancel signal, similar toCtrl-D
on Unix andCtrl-Z
on DOS.Clear
will refresh the screen. This is especially useful when you disconnect a terminal session then reconnect.- The
PF
keys act as soft function keys
Device Commands
You can send special device commands to the display driver. These can normally be entered at any time, not just at the #
prompt. Device commands all start with a %
and can be abbreviated like MTS commands. Note that device commands will not appear in the terminal history after you press Enter
.
%?
will display the current terminal settings with output similar to the below.
Roll mode Rate=5 Duplex=on Width=078 Timeout=off
Dcc="%" Keyboard=lc Hex=off "'" Buffer=04 Tabs=off "?"
PA1 = attention interrupt PA2 (CNCL) = end of file
CLEAR = refresh screen SYS REQ = pause / continue
PF1 =%Wb=* PF2 =$Copy *msource*@sp * PF3 =%?
PF4 =%Wf=* PF5 =%Mode=page PF6 =%Enter
PF7 =%Wf PF8 =%Mode=line PF9 =%Mode=roll
PF10=%Wl PF11=%Wl=60 PF12=%Wr=60
PF13=%Wb=* PF14=$Copy *msource*@sp * PF15=%?
PF16=%Wf=* PF17=%Mode=page PF18=%Enter
PF19=%Wf PF20=%Mode=line PF21=%Mode=roll
PF22=%Wl PF23=%Wl=60 PF24=%Wr=60
Function keys
The output of %?
will list the current function keys. You can redefine these with %PFn cmd
, so for example if you wanted PF2
to display file information using the $filestatus
command you could enter
%pf2 $filestatus
Note that you do not need to press Enter
after using a function key.
Scrolling
The mode determines how the screen will display output when there is more than one screen of text. Available modes area:
%roll
where the screen will scroll up slowly when the bottom of the page is reached. This is the default mode.%line
is similar to roll but the screen will be cleared, previous output moved up and further output starts from the middle.%fast
where the whole output is displayed quickly with no scrolling or pausing.%page
where a page of output is displayed at a time. To move to the next page you press theSysReq
orAttn
key - however I have not got those keys to work, at least on x3270; instead I redefined PF3 to act as the pause/continue key using%pf3 %pause
.
You can adjust the rate of scrolling with %rate N
where N is a number between 1 (slowest) and 9 (fastest), default being 5.
You can scroll the display backwards and forwards using %wb
and %wf
; these are conveniently bound to PF1
and PF4
.
Other useful commands
%activity
will display the current task’s status and resource utilisation.%grab
will start a second command session using the same terminal. You can then switch between the two sessions by using%flip
.%quit
will force a disconnect - useful if your session has crashed.%reset
will return all device settings you have changed back to their defaults.%timeout off
will prevent your terminal from being logged out after 30 minutes of inactivity.
More information
See the 3270 chapter in MTS Volume 4: Terminals and Networks in MTS on the MTS Archive for a full description of how to use the terminal and other device commands.
Note that the operator’s console uses a different set of device commands; see the Operator’s Manual for more details.