Those Pesky Square Bracket Characters
Most IBM 3270 emulators have some degree of difficulty with the square-bracket
characters, [ and ]. The problem is that there is not a consistent
definition of what EBCDIC codes represent them.
The Possibilities
Depending on the host OS, mode, and intermediate facilities, the square
bracket characters may be displayed as:
-
X'BA' and X'BB' (defined in the IBM Chararcter Set Reference as
standard EBCDIC characters)
-
X'AD' and X'BD' (as some old hosts appear to do by convention)
-
GE X'AD' and GE X'BD' (defined in the IBM Character Set Reference
as APL2 characters)
-
GE X'BA' and GE X'BB' (just plain wrong, but some hosts insist that X'BA'
and X'BB' must be displayed with a GE)
Note that OS modes can also change how these characters are displayed.
For example, the CMS command terminal apl on causes the Graphic
Escape (GE) to be used when displaying EBCDIC codes X'BA', X'BB', X'AD'
and X'BD', while terminal apl off causes them to be displayed without
it.
x3270 Facilities
x3270 has two facilities to deal with this situation: character sets and
keymaps. By selecting the correct character set and keymap, you can set
up x3270 to generate and display the proper codes for the square-bracket
characters.
The default character set is called bracket. The bracket
character set implements the 'old hosts' convention listed above. When
bracket
is used:
-
The [ key generates the EBCDIC code X'AD'.
-
The ] key generates the EBCDIC code X'BD'.
-
The EBCDIC code X'AD' is displayed as a [.
-
The EBCDIC code X'BD' is displayed as a ].
Another common character set is called us. This character set implements
the IBM "U.S. English" character set:
-
The [ key generates the EBCDIC code X'BA'.
-
The ] key generates the EBCDIC code X'BB'.
-
The EBCDIC code X'BA' is displayed as a [.
-
The EBCDIC code X'BB' is displayed as a ].
An additional character set is called gebracket. This character
set is for hosts that use IBM "U.S. English" character set, but put a GE
in front of the EBCDIC codes X'BA' and X'BB' when displaying them:
-
The [ key generates the EBCDIC code X'BA'.
-
The ] key generates the EBCDIC code X'BB'.
-
The EBCDIC code GE X'BA' is displayed as a [.
-
The EBCDIC code GE X'BB' is displayed as a ].
Finally, there is the apl character set and the apl keymap,
which are usually used together by specifying the -apl command-line
option. With the -apl option:
-
The [ key generates the EBCDIC code GE X'AD'.
-
The ] key generates the EBCDIC code GE X'BD'.
-
The EBCDIC code GE X'AD' is displayed as a [.
-
The EBCDIC code GE X'BD' is displayed as a ].
Here is a table which summarizes the combinations of characters generated
and displayed in the various modes.
|
keyboard generates
|
graphic displayed for EBCDIC codes
|
x3270 Mode |
[ key
|
] key
|
X'BA'
|
X'BB'
|
GE X'BA'
|
GE X'BB'
|
X'AD'
|
X'BD'
|
GE X'AD'
|
GE X'BD'
|
charset bracket (default) |
X'AD' |
X'BD'
|
Ý
|
¨
|
|
|
[
|
]
|
[
|
]
|
charset us |
X'BA'
|
X'BB'
|
[
|
]
|
|
|
Ý
|
¨
|
[
|
]
|
charset gebracket |
X'BA'
|
X'BB'
|
[
|
]
|
[
|
]
|
Ý
|
¨
|
[
|
]
|
-apl |
GE X'AD'
|
GE X'BD'
|
[
|
]
|
|
|
Ý
|
¨
|
[
|
]
|
So, if your display shows one of the graphics above instead of the desired
square-bracket characters, you might want to try one of the other modes.