Setting up translation tables to avoid incorrect translation of characters used by Web eg. '!'

Date:30 October 2001
Product/Release:Visual LANSA and LANSA for the Web
Abstract:Setting up translation tables to avoid incorrect translation of '!'
Submitted By:LANSA Technical Support
Last Review22 August 2005

This tip has 2 parts

  1. Explanation of how translation tables need to established to avoid incorrect translation of certain characters i.e. "!', "[", "]", "^", and "|".
  2. Steps to fix the translation tables for the following characters: ![]^|

1. Incorrect translation of '!' used by Web to denote comments.
Details : When exporting or checking in/out generated HTML, XML or RDML code to/from Visual LANSA, a problem will occur when using the system default EBCDIC/ASCII translation tables located in library QSYS. The symptom of this problem is the appearance of comments on Web pages, which should be hidden. This is caused by the incorrect translation of the "!", "[", "]", "^", and "|" characters.

In LANSA on iSeries, the definitions required to run the Host Monitor and to export using the PC export type can be created using the LANSA REQUEST(PCMAINT), or can be created automatically by performing a System Initialization from visual LANSA. The names of the translation tables used to convert data to and from EBCDIC and ASCII are included in these definitions. These tables are only used by export to PC and the Host Monitor and NOT by LANSA OPEN or Super Server which have their own tables.

If you are an English language user with code page 037, USB keyboard language type, and are using modified translation tables and have this problem, you will need to change the entry for "5A" to translate to "21" in the EBCDIC to ASCII table and entry "21" to translate to "5A" in the ASCII to EBCDIC table.

If you are using a language other than English and a different code page you will have to add the appropriate characters to handle the correct translation of the exclamation mark.

When exporting from LANSA on iSeries to Visual LANSA, the export program looks first in PCMAINT for a PC definition called WIN_DFT. If it does not find it, it uses default table names of QASCII and QEBCDIC which are IBM supplied AS/400 tables. You can modify existing PC definitions in PCMAINT to use the your own modified tables for the Host Monitor and/or modify/create the WIN_DFT definition for exporting.

For help in creating the PC definition refer to the LANSA for iSeries User Guide, section LANSA PC Development, Defining Personal Computers to LANSA, Creating (Changing) PC Definitions.

2. Steps to fix the translation tables for the following characters: ![]^|

The information below is an extension to step 1 and includes the steps to fix the translation tables.

The tables are changed using the following OS/400 commands:

WRKTBL QEBCDIC
WRKTBL QASCII

Use the Work with Table Dialogue to copy the tables (i.e. save them), then
convert the tables to text files using the RTVTBLSRC command , e.g. :

RTVTBLSRC TBL(QEBCDIC)
SRCFILE(QGPL/QCLSRC)

RTVTBLSRC TBL(QASCII)
SRCFILE(QGPL/QCLSRC)

Now use SEU to edit both source file members created by RTVTBLSRC.

as per the following tables :

Changes to table QSYS/QEBCDIC
Char     Source File    Original Value     New Value
!          L02P03          4F                    5A
[          L03P55          4A                    BA
]          L03P59          5A                    BB
^         L03P61          5F                    B0
|          L04P57          6A                   4F

Changes to table QSYS/QASCII
Char     Source File     Original Value     New Value
!          L03P53           5D                    21
[          L06P53           E2                    5B
]          L06P55           E3                    5D
^         L06P33           D8                    5E
|          L03P31           21                    7C

Example :

In QASCII , change Line(3),position(53),length(2) to 21
In QEBCDIC , change Line(2),position(3),length(2) to 5A

Delete the 2 tables and now recreate them from the amended text files with
the CRTTBL command, e.g. :

Please refer to details in the section above as you may wish to store the new tables somewhere else instead of overriding the default IBM supplied tables. Otherwise use :

CRTTBL TBL(QSYS/QEBCDIC)
SRCFILE(QGPL/QCLSRC)

CRTTBL TBL(QSYS/QASCII)
SRCFILE(QGPL/QCLSRC)