IBM Support

Customizing the Code Page 37 to 437 Translation Table

Troubleshooting


Problem

This document provides instructions for using your own translation table for converting USA/Canada EBCDIC Code Page 37 to ASCII Code Page 437 when using Host Print Transform (HPT).

Resolving The Problem

This document provides instructions for using your own translation table for converting USA/Canada EBCDIC Code Page 37 to ASCII Code Page 437 when using Host Print Transform (HPT). This is done by retrieving and modifying a Workstation Customization Table (WSCST) and changing the values in the Overriding the Default ASCII Code Page (DFTASCP) and EBCDIC-to-ASCII Table Entry (EBCASCTBLE) tags.

For information on customizing the Code Page 37 to 850 translation table, please refer to the following document:

N1010136: Customizing the Code Page 37 to 850 Translation Table

This document was last updated on 5 November 2013.

Caution: These instructions are provided as is. Any assistance with editing the Workstation Customization Table must be done through a consulting agreement.


Basic Steps for Creating and Using a Workstation Customization Object

The following are the basic steps for creating and using a Workstation Customization Object (WSCST). Regardless of the particular issue(s) you are attempting to resolve, these steps must always be taken. This information is intended to provide a 'quick start' to creating a WSCST object for users who have at least some familiarity with creating them and with configuring printers.

Note: Additional, in-depth details for creating a WSCST object can be found in the following document:

N1010140: Instructions for Modifying a Workstation Customizing Object (WSCST)

The following are the basic 'quick start' steps.

Step 1: Retrieve the WSCST source code. Type the following command on the operating system command line:

Important Note: Use the Manufacturer type and model (MFRTYPMDL) that is appropriate for your printer. Also, the Source member (in the following example, HP4) is a name that is appropriate to your customizing object. This is what you will be calling your workstation customizing object in Step 3.

RTVWSCST DEVTYPE(*TRANSFORM) MFRTYPMDL(*HP4) SRCMBR(HP4)
         SRCFILE(QGPL/QTXTSRC)

Press the Enter key.

Step 2: Edit the source code by using PDM or SEU:
oTo use PDM, on the operating system command line type the following:

WRKMBRPDM FILE(QGPL/QTXTSRC) MBR(HP4)

Press the Enter key. Select Option 2 to edit.
oTo use SEU, on the operating system command line type the following:

STRSEU SRCFILE(QGPL/QTXTSRC) SRCMBR(HP4)

Press the Enter key.
Make any changes necessary to the WSCST object source code. Refer to the following section Converting Text to ASCII Code Page 437 to make your changes, then save and exit. Continue with Step 3.

Step 3: Create the WSCST object using the CRTWSCST command. On the operating system command line type the following:

Important Note: Match the SRCMBR name from Step 1 to the WSCST object name that is created in this step.

CRTWSCST WSCST(QGPL/HP4) SRCFILE(QGPL/QTXTSRC)

Press the Enter key.

Step 4: Add the WSCST to the printer configuration by using the Change Device Print command (CHGDEVPRT), the Change Output Queue command (CHGOUTQ), or by changing the PC5250 printer emulation session configuration.
oTo add the WSCST to a device description, on the operating system command line type the following:

CHGDEVPRT DEVD(device_name) TRANSFORM(*YES) MFRTYPMDL(*WSCSTLETTER)
          WSCST(QGPL/HP4)

Press the Enter key.
oTo add the WSCST to a remote output queue description, on the operating system command line type the following:

CHGOUTQ OUTQ(queue_name) TRANSFORM(*YES) MFRTYPMDL(*WSCSTLETTER)
        WSCST(HP4)

Press the Enter key.
oTo add the WSCST to a PC5250 printer emulation session, do the following:

a In the PC5250 printer session, click on Communication > Configure.
b Click on the Setup button.
c In the Configure PC5250 Printer Emulation window, select the box next to Transform Print Data to ASCII on the iSeries and select the Printer Model value of *WSCST.
d In the same window, specify the name of the WSCST in the Customizing Object parameter and the library where it is found in the Library parameter, for example, Customizing Object HP4 and Library QGPL.
e Click OK three times.
f Click File > Save to save the configuration.

Note: If any changes are made to the WSCST object source code after the CRTWSCST command has been issued, it is necessary to issue the CRTWSCST command again. The printer writer must be ended and restarted for the changes to take effect.


Converting Text to ASCII Code Page 437

By default, Host Print Transform (HPT) converts all text to ASCII Code Page 437 using the Q037BF437 translation table. The following DFTASCCP (Default ASCII Code Page) tag can be used to explicitly reference ASCII Code Page 437. This is not necessary:

:DFTASCCP
      ASCIICP=437.

Note: Examples of the various Code Pages, including EBCDIC Code Page 37 (USA/Canada - CECP) and ASCII Code Page 437 (Personal Computer), can be found in Adobe Acrobat PDF format on the IBM® Coded Character Set Reference Material web page at the following URL:

http://www-01.ibm.com/software/globalization/cp/cp_cpgid.html


Customizing the Code Page 37 to 437 Translation Table

To make a change in the translation table, you must make an entry for each code point. This is a tedious job but can be done. Type (or cut and paste) the following after the :EASCCPINFO tag or before the :EWSCST tag, which is the last tag in the WSCST source member:

:EBCASCTBL.
   :EBCASCTBLE
     EBCDICCP = 37
     ASCIICP  = 437
     DATA =
    /* -0-1-2-3-4-5-6-7-8-9-A-B-C-D-E-F */
      '2020838485A0A68687A49B2E3C282B7C'X      /* 4- */
      '268288898AA18C8B8DE121242A293BAA'X      /* 5- */
      '2D2F838E85A0A68F80A57C2C255F3E3F'X      /* 6- */
      '6F9088898AA18C8B8D603A2340273D22'X      /* 7- */
      'ED616263646566676869AEAF647900F1'X      /* 8- */
      'F86A6B6C6D6E6F707172A6A791009200'X      /* 9- */
      'E67E737475767778797AADA844590000'X      /* A- */
      '5E9C9DFA001514ACAB005B5D00DB27DD'X      /* B- */
      '7B41424344454647484900939495A2A7'X      /* C- */
      '7D4A4B4C4D4E4F50515200968197A398'X      /* D- */
      '5CF6535455565758595AFD939995E0DC'X      /* E- */
      '3031323334353637383900969A97A300'X.     /* F- */
   :EEBCASCTBL.


The values in the above EBCASCTBLE (EBCDIC-to ASCII-Table Entry) tag are obtained from the Q037BF437 EBCDIC-to-ASCII translation table. The following Work with Tables (WRKTBL) command can be used to view this translation table:

WRKTBL TBL(QUSRSYS/Q037BF437)

The table is set up for EBCDIC with the first character of the code represented on the right column (/* 4- */) and the second character of the hex code in the top line /* -0-1-2 .... */. The first translation in the example is an EBCDIC Space character (X'40') that is translated to an ASCII Space character (X'20').

Note: The entire table must be entered to change even a single code point. If you are viewing this document online or if it has been e-mailed to you, it is easiest to simply copy lines from this document and then paste them into your source member. If this file has been faxed to you, the table will have to be typed exactly as shown above. If the table is not typed correctly, it could cause some characters in your operating system spooled files to be translated to the wrong ASCII character which would cause them to print incorrectly.

Example of Translating the EBCDIC Logical Not Sign ('¬') Character to Represent an ASCII Escape Control Character (X'1B')

A Logical Not Sign ('¬') character is code point X'5F' in EBCDIC Code Page 37. Therefore, to translate a Logical Not Sign ('¬') character to an ASCII Escape control character (X'1B'), the X'5F' position in the table must be changed from its current setting of X'AA' (a Logical Not Sign character in ASCII Code Page 437) to X'1B'. This can be done using the following EBCASCTBL (EBCDIC-to-ASCII Mapping Table) and EBCASCTBLE (EBCDIC-to-ASCII Mapping Table Entry) tags:

    :EBCASCTBL.
   :EBCASCTBLE
     EBCDICCP = 37
     ASCIICP  = 437
     DATA =
    /* -0-1-2-3-4-5-6-7-8-9-A-B-C-D-E-F */
      '2020838485A0A68687A49B2E3C282B7C'X      /* 4- */
      '268288898AA18C8B8DE121242A293B
1B'X      /* 5- */
      '2D2F838E85A0A68F80A57C2C255F3E3F'X      /* 6- */
      '6F9088898AA18C8B8D603A2340273D22'X      /* 7- */
      'ED616263646566676869AEAF647900F1'X      /* 8- */
      'F86A6B6C6D6E6F707172A6A791009200'X      /* 9- */
      'E67E737475767778797AADA844590000'X      /* A- */
      '5E9C9DFA001514ACAB005B5D00DB27DD'X      /* B- */
      '7B41424344454647484900939495A2A7'X      /* C- */
      '7D4A4B4C4D4E4F50515200968197A398'X      /* D- */
      '5CF6535455565758595AFD939995A2DC'X      /* E- */
      '3031323334353637383900969A97A300'X.     /* F- */
   :EEBCASCTBL.


Example of Translating the EBCDIC Karat ('^') Character to Represent an ASCII Escape Control Character (X'1B')

A Karat ('^') character is code point X'B0' in EBCDIC Code Page 37. Therefore, to translate a Karat ('^') character to an ASCII Escape control character (X'1B'), the X'B0' position in the table must be changed from its current setting of X'5E' (a Karat character in ASCII Code Page 437) to X'1B'. This can be done using the following EBCASCTBL (EBCDIC-to-ASCII Mapping Table) and EBCASCTBLE (EBCDIC-to-ASCII Mapping Table Entry) tags:

:EBCASCTBL.
   :EBCASCTBLE
     EBCDICCP = 37
     ASCIICP  = 437
     DATA =
    /* -0-1-2-3-4-5-6-7-8-9-A-B-C-D-E-F */
      '2020838485A0A68687A49B2E3C282B7C'X      /* 4- */
      '268288898AA18C8B8DE121242A293BAA'X      /* 5- */
      '2D2F838E85A0A68F80A57C2C255F3E3F'X      /* 6- */
      '6F9088898AA18C8B8D603A2340273D22'X      /* 7- */
      'ED616263646566676869AEAF647900F1'X      /* 8- */
      'F86A6B6C6D6E6F707172A6A791009200'X      /* 9- */
      'E67E737475767778797AADA844590000'X      /* A- */
      '
1B9C9DFA001514ACAB005B5D00DB27DD'X      /* B- */
      '7B41424344454647484900939495A2A7'X      /* C- */
      '7D4A4B4C4D4E4F50515200968197A398'X      /* D- */
      '5CF6535455565758595AFD939995A2DC'X      /* E- */
      '3031323334353637383900969A97A300'X.     /* F- */
   :EEBCASCTBL.


Example of Translating the EBCDIC Exclamation Point ('!') Character to Represent an ASCII Escape Control Character (X'1B')

An Exclamation Point ('!') character is code point X'5A' in EBCDIC Code Page 37. Therefore, to translate an Exclamation Point ('!') character to an ASCII Escape control character (X'1B'), the X'5A' position in the table must be changed from its current setting of X'21' (an Exclamation Point character in ASCII Code Page 437) to X'1B'. This can be done using the following EBCASCTBL (EBCDIC-to-ASCII Mapping Table) and EBCASCTBLE (EBCDIC-to-ASCII Mapping Table Entry) tags:

 :EBCASCTBL.
   :EBCASCTBLE
     EBCDICCP = 37
     ASCIICP  = 437
     DATA =
    /* -0-1-2-3-4-5-6-7-8-9-A-B-C-D-E-F */
      '2020838485A0A68687A49B2E3C282B7C'X      /* 4- */
      '268288898AA18C8B8DE1
1B242A293BAA'X      /* 5- */
      '2D2F838E85A0A68F80A57C2C255F3E3F'X      /* 6- */
      '6F9088898AA18C8B8D603A2340273D22'X      /* 7- */
      'ED616263646566676869AEAF647900F1'X      /* 8- */
      'F86A6B6C6D6E6F707172A6A791009200'X      /* 9- */
      'E67E737475767778797AADA844590000'X      /* A- */
      '5E9C9DFA001514ACAB005B5D00DB27DD'X      /* B- */
      '7B41424344454647484900939495A2A7'X      /* C- */
      '7D4A4B4C4D4E4F50515200968197A398'X      /* D- */
      '5CF6535455565758595AFD939995A2DC'X      /* E- */
      '3031323334353637383900969A97A300'X.     /* F- */
   :EEBCASCTBL.


Example of Using DDS in an RPG Program to Send ASCII Escape Sequences to an ASCII Printer

This is an example of a DDS using the Karat ('^') character to represent an ASCII Escape control character (X'1B') to place ASCII printer controls in an operating system spooled file. This example must be used with the Example of Translating the EBCDIC Karat ('^') Character to Represent an ASCII Escape Control Character (X'1B') above to work properly. The RPG program is assuming that the characters for the ASCII printer controls are going to be entered in EBCDIC and later translated by Host Print Transform (HPT) to the corresponding ASCII characters.

5763PW1 V3R1M0  940909                  SEU SOURCE LISTING
 SOURCE FILE . . . . . . .  XZY0756/QDDSSRC
 MEMBER  . . . . . . . . .  BCASCII
 SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 .
   100      A******************
   200      A* LABEL LAYOUT *
   300      A******************
   400                 R LABELA1
   500                                             SKIPB(001)
   600      A* RESET
   700                                            1'^E'
   800                                             SPACEA(001)
   900      A* SIZE
  1000                                            1'^&l2A'
  1100      A* LANDSCAPE
  1200                                           +1'^&l10'
  1300                                             SPACEA(001)
  1400      A********************
  1500      A* PART NUMBER *
  1600      A********************
  1700      A* SELECT FONT
  1800                                            1'^(0Y^(s1p12.00v0s0b4101T'
  1900      A* POSITION CURSOR
  2000                                           +1'^*p350x250Y'
  2100                                           +1'PART NO.:'
  2200      A* POSITION CURSOR
  2300                                           +1'^*p350x290Y'
  2400                                           +1'(P)'
  2500                                             SPACEA(001)
  2600      A* SELECT FONT
  2700                                            1'^(8U^(s1p24.00v0s3b4148T'
  2800      A* POSITION CURSOR
  2900                                           +1'^*p600x310Y'
  3000      A* PART NUMBER
  3100                   PARTN1        15A       +1
  3200                                             SPACEA(001)
  3300      A********************
  3400      A* BAR CODES   *
  3500      A********************
  3600      A* SELECT BAR CODE
  3700                                            1'^(0Y^(s0p4.69h12.0v0s0b0T'
  3800                                             SPACEA(001)
  3900      A********************
  4000      A* PART NO BAR CODES
  4100      A********************
  4200      A* POSITION CURSOR
  4300                                            1'^*p400x400Y'
  4400      A* PART NO BAR CODE 1
  4500                   PART1A        17A       +0
  4600                                             SPACEA(001)
  4700
                               * * * *  E N D  O F  S O  U  R C E  * * * *


To create the WSCST object and implement it, perform Steps 3 and 4, (above).

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"6.1.0"}]

Historical Number

8693051

Document Information

Modified date:
18 December 2019

UID

nas8N1010137