Sunday, 8 November 1998

Using x3270 with an IBM AS/400

There have been a few questions asked on about accessing an AS/400 “green screen” display from Unix. This page describes how I had it set it up very nicely under Linux using the x3270 terminal emulator.

My environment was:

  • A model 4609-510 AS/400 with OS/400 V4R2, and configured for TCP/IP on an Ethernet LAN.
  • A IBM PC with a Pentium processor running Debian GNU/Linux 2.0.
  • The version of x3270 from this version of Debian, which is
  • I’ve used this basic setup for versions of x3270 from before, and from OS/400 V3R6.

(Since I first wrote this document, a few links to it have appeared on various web pages, and I’ve started then stopped maintaining x3270 for Debian.)


The first thing to do is to get x3270 compiled, installed and configured to connect to the AS/400 system. This is all fairly well covered in x3270’s documentation, so I won’t expand on it here.

When you connect to the AS/400 using x3270, you will (surprise!) be using a 3270 data stream, which the AS/400 converts to a 5250 data stream for you. Recent versions of x3270 emulate a 3279 device, which has the enhanced features necessary for all the colours and highlighting to be displayed. In fact, I found the effects to be closer to what is described in the DDS Reference than any other PC emulator.

System Request support

A problem with all official releases of x3270 up to, is that there is no way to use System Request to interrupt a display that has the keyboard locked. The new TN3270E RFC defines the 3270 Attn function as sending a telnet ‘Interrupt Process’ code, which is not what x3270 normally sends. It turns out that the AS/400 supports this code for System Request.

For System Request to work properly, I recommend compiling the latest version of x3270.

Configuring for AS/400

All the configuration you need should be taken care of by my .x3270pro file. Make sure there’s nothing you want to keep in your current one, then drop mine in your home directory. If you’re the latest version of x3270, use the .x3270pro patched file instead. Then start up x3270 and try it!

This is what the file actually does:

  • The first long section following “x3270.keymap.5250” defines a new keyboard mapping that translates the key you press (like F2) into what the AS/400 emulator wants to see (PA1 followed by PF2). A special one is Shift-Home, which is useful with SDA. You’ll know if you need it.
  • You must use a model 2 (with an 80x24 screen) because that’s the size of screen the AS/400 draws on.
  • I use the ‘alt’ character set to enable my Alt key, overridden by the 5250 mappings above.
  • The ‘us-intl’ character set seems to correspond almost exactly with CCSID 37, which is the default CCSID at my site. This represents the US English code page. In particular, the brackets ‘[’ and ‘]’ work. (See some of the members in QSYSINC/H for examples.) Only the pilcrow sign ‘¶’ is represented differently.
  • ‘blankFill’ makes entry fields work better when inserting at the start.


  • Unfortunately, the 3270 display does not support the keyboard shift and validation of a real 5250 and these functions are provided by the AS/400. This means that input in an uppercase only field will appear however you type it.
  • The Field Exit, Field + and Field - keys are not supported by the AS/400’s emulation, so my key mappings simulate it by erasing to the end of the field then tabbing to the next field. This usually works fine except with negative numbers, which I have trouble with. ISTR having other problems on V3R6.