#### "Linux Gazette...making Linux just a little more fun!"

## x3270 and Linux

#### By Chris Mason, h.c.mason@lmco.com

Everyday I have to logon to The MVS (Multiple Virtual Storage) Operating System and edit COBOL (Common Business Oriented Language) program source code. When I first started being a COBOL programmer in 1985, we all used dumb terminals such as the IBM 3278. As time passed, people starting getting IBM PC compatibles and such things as IRMA cards were used to connect the IBM PC to the Mainframe and make it look like a dumb terminal.

After receiving an IBM PC compatible myself, I added an extra SCSI harddisk and installed Linux. Using Linux's TCP/IP capability, and the driver for the 3COM ethernet card in the computer, I was able to connect Linux to the network.

I began to try to logon to the IBM Mainframe. I found that there were several differences between the standard Telnet VT100 terminal model and the IBM 3270 terminals. I needed a new tool so that I could use the features of the IBM 3270 such as function keys.

Fortunately, there are two tools to emulate the IBM 3270 type terminal. One is known as tn3270, and the other is x3270.

X3270 is a program that is available with man Linux distributions and is available on ftp.x.org and other mirror sites.

As a mainframe programmer, I have noticed the following advantages over a dumb terminal:

1. x3270 can print the screen contents on a network printer and is easily configurable.
2. Key strokes can be mapped to the 3270 keys.
3. x3270 can operate under a script, or run a script, allowing automated logons and data entry tasks.
4. There is a type-ahead feature. The dumb terminal won't accept extra characters, but linux will.

X3270 comes with various resources that can be configured by the user. Here is contents of my .Xdefaults file apropos x3270:

    ! Set the font used in the x3270 screen:
    x3270.emulatorFont:    3270-12
    ! Set the model of 3270 family terminal
    x3270.model:   3
    ! Set the default print command:
    x3270.printTextCommand: lpr -Psmb
    ! Set the keymap translation to use.  I found hp-pc to be the most
    ! compatible:
    x3270.keymap:     hp-pc
    ! The below is a user keymap which allows me to override the
    ! default keymapping.  This way I can set the previous (page up)
    ! key to PF7 which is set to PREV on most ISPF edit panels,
    ! and page down to PF8 which is DOWN on edit
    ! EraseEOF is a function to erase a field to end of field
    ! here I map both ctrl delete and alt delete to this function.
    x3270.keymap.hp-pc.user: \
       <Key>Prior:     PF(7)\n\
       <Key>Next:      PF(8)\n\
       Ctrl<Key>Delete:    EraseEOF()\n\
       Meta<Key>Delete:    EraseEOF()\n

X3270 has several other features. One nice feature is the file /usr/lib/X11/x3270/ibm_hosts which contains a list of IBM hosts to appear on a logon menu.

I would say that this is a great program and makes logining on to an IBM Mainframe a breeze.

X3270 comes with manual pages and some documentation. Here are the copyrights from the x3270 manual page:

COPYRIGHTS

Modifications Copyright 1993, 1994, 1995, 1996, 1997 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.

##### Copyright © 1997, Chris Mason
Published in Issue 23 of the Linux Gazette, December 1997