IBM Support

Customizing the Code Page 37 to 850 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 850 when using Host Print Transform (HPT).

Resolving The Problem

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


This document provides instructions for using your own translation table for converting USA/Canada EBCDIC Code Page 37 to ASCII Code Page 850 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.

This document was last updated on 5 November 2013.




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

N1010137: Customizing the Code Page 37 to 437 Translation Table


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 850 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 850

By default, Host Print Transform (HPT) converts all text to ASCII Code Page 437 using the Q037BF437 translation table. However, the following DFTASCCP (Default ASCII Code Page) tag can be used to change the default to ASCII Code Page 850:

:DFTASCCP
      ASCIICP=850.

Note: Examples of the various Code Pages, including EBCDIC Code Page 37 (USA/Canada - CECP) and ASCII Code Page 850 (Personal Computer - Multilingual Page), 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 Code Page 37 to 850 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 copy and paste) the following EBCASCTBL (EBCDIC-to-ASCII Mapping Table), EBCASCTBLE (EBCDIC-to-ASCII Mapping Table Entry) and EEBCASCTBL (End EBCDIC-to-ASCII Mapping Table) tags after the :EASCCPINFO tag or before the :EWSCST tag (which is the last tag in the WSCST source member):

:EBCASCTBL.
   :EBCASCTBLE
     EBCDICCP = 37
     ASCIICP  = 850
     DATA =
    /* -0-1-2-3-4-5-6-7-8-9-A-B-C-D-E-F */
      '2020838485A0C68687A4BD2E3C282B7C'X      /* 4- */
      '268288898AA18C8B8DE121242A293BAA'X      /* 5- */
      '2D2FB68EB7B5C78F80A5DD2C255F3E3F'X      /* 6- */
      '9B90D2D3D4D6D7D8DE603A2340273D22'X      /* 7- */
      '9D616263646566676869AEAFD0ECE7F1'X      /* 8- */
      'F86A6B6C6D6E6F707172A6A791F792CF'X      /* 9- */
      'E67E737475767778797AADA8D1EDE8A9'X      /* A- */
      '5E9CBEFAB8F5F4ACABF35B5DEEF9EF9E'X      /* B- */
      '7B414243444546474849F0939495A2E4'X      /* C- */
      '7D4A4B4C4D4E4F505152FB968197A398'X      /* D- */
      '5CF6535455565758595AFDE299E3E0E5'X      /* E- */
      '30313233343536373839FCEA9AEBE900'X.     /* F- */
   :EEBCASCTBL.


Note: There should only be one EBCASCTBL (EBCDIC-to-ASCII Mapping Table) tag and only one EEBCASCTBL (End EBCDIC-to-ASCII Mapping Table) tag in the WSCST source code. If these tags already exist in the source code, any new EBCASCTBLE (EBCDIC-to-ASCII Mapping Table Entry) tags should be added immediately before or immediately after the existing EBCASCTBLE tags (and between the existing EBCASCTBL and EEBCASCTBL tags).

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

WRKTBL TBL(QUSRSYS/Q037BF850)

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'), which 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 copy lines from this document and 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 850) to X'1B'. This can be done using the following EBCASCTBL (EBCDIC-to-ASCII Mapping Table), EBCASCTBLE (EBCDIC-to-ASCII Mapping Table Entry) and EEBCASCTBL (End EBCDIC-to-ASCII Mapping Table) tags:

:EBCASCTBL.
   :EBCASCTBLE
     EBCDICCP = 37
     ASCIICP  = 850
     DATA =
    /* -0-1-2-3-4-5-6-7-8-9-A-B-C-D-E-F */
      '2020838485A0C68687A4BD2E3C282B7C'X      /* 4- */
      '268288898AA18C8B8DE121242A293B
1B'X      /* 5- */
      '2D2FB68EB7B5C78F80A5DD2C255F3E3F'X      /* 6- */
      '9B90D2D3D4D6D7D8DE603A2340273D22'X      /* 7- */
      '9D616263646566676869AEAFD0ECE7F1'X      /* 8- */
      'F86A6B6C6D6E6F707172A6A791F792CF'X      /* 9- */
      'E67E737475767778797AADA8D1EDE8A9'X      /* A- */
      '5E9CBEFAB8F5F4ACABF35B5DEEF9EF9E'X      /* B- */
      '7B414243444546474849F0939495A2E4'X      /* C- */
      '7D4A4B4C4D4E4F505152FB968197A398'X      /* D- */
      '5CF6535455565758595AFDE299E3E0E5'X      /* E- */
      '30313233343536373839FCEA9AEBE900'X.     /* F- */
   :EEBCASCTBL.


Note: There should only be one EBCASCTBL (EBCDIC-to-ASCII Mapping Table) tag and only one EEBCASCTBL (End EBCDIC-to-ASCII Mapping Table) tag in the WSCST source code. If these tags already exist in the source code, any new EBCASCTBLE (EBCDIC-to-ASCII Mapping Table Entry) tags should be added immediately before or immediately after the existing EBCASCTBLE tags (and between the existing EBCASCTBL and EEBCASCTBL tags).

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. So, 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 850) to X'1B'. This can be done using the following EBCASCTBL (EBCDIC-to-ASCII Mapping Table), EBCASCTBLE (EBCDIC-to-ASCII Mapping Table Entry) and EEBCASCTBL (End EBCDIC-to-ASCII Mapping Table) tags:

:EBCASCTBL.
   :EBCASCTBLE
     EBCDICCP = 37
     ASCIICP  = 850
     DATA =
    /* -0-1-2-3-4-5-6-7-8-9-A-B-C-D-E-F */
      '2020838485A0C68687A4BD2E3C282B7C'X      /* 4- */
      '268288898AA18C8B8DE1
1B242A293BAA'X      /* 5- */
      '2D2FB68EB7B5C78F80A5DD2C255F3E3F'X      /* 6- */
      '9B90D2D3D4D6D7D8DE603A2340273D22'X      /* 7- */
      '9D616263646566676869AEAFD0ECE7F1'X      /* 8- */
      'F86A6B6C6D6E6F707172A6A791F792CF'X      /* 9- */
      'E67E737475767778797AADA8D1EDE8A9'X      /* A- */
      '5E9CBEFAB8F5F4ACABF35B5DEEF9EF9E'X      /* B- */
      '7B414243444546474849F0939495A2E4'X      /* C- */
      '7D4A4B4C4D4E4F505152FB968197A398'X      /* D- */
      '5CF6535455565758595AFDE299E3E0E5'X      /* E- */
      '30313233343536373839FCEA9AEBE900'X.     /* F- */
   :EEBCASCTBL.


Note: There should only be one EBCASCTBL (EBCDIC-to-ASCII Mapping Table) tag and only one EEBCASCTBL (End EBCDIC-to-ASCII Mapping Table) tag in the WSCST source code. If these tags already exist in the source code, then any new EBCASCTBLE (EBCDIC-to-ASCII Mapping Table Entry) tags should be added immediately before or immediately after the existing EBCASCTBLE tags (and between the existing EBCASCTBL and EEBCASCTBL tags).

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 850) to X'1B'. This can be done using the following EBCASCTBL (EBCDIC-to-ASCII Mapping Table), EBCASCTBLE (EBCDIC-to-ASCII Mapping Table Entry) and EEBCASCTBL (End EBCDIC-to-ASCII Mapping Table) tags:

:EBCASCTBL.
   :EBCASCTBLE
     EBCDICCP = 37
     ASCIICP  = 850
     DATA =
    /* -0-1-2-3-4-5-6-7-8-9-A-B-C-D-E-F */
      '2020838485A0C68687A4BD2E3C282B7C'X      /* 4- */
      '268288898AA18C8B8DE121242A293BAA'X      /* 5- */
      '2D2FB68EB7B5C78F80A5DD2C255F3E3F'X      /* 6- */
      '9B90D2D3D4D6D7D8DE603A2340273D22'X      /* 7- */
      '9D616263646566676869AEAFD0ECE7F1'X      /* 8- */
      'F86A6B6C6D6E6F707172A6A791F792CF'X      /* 9- */
      'E67E737475767778797AADA8D1EDE8A9'X      /* A- */
      '
1B9CBEFAB8F5F4ACABF35B5DEEF9EF9E'X      /* B- */
      '7B414243444546474849F0939495A2E4'X      /* C- */
      '7D4A4B4C4D4E4F505152FB968197A398'X      /* D- */
      '5CF6535455565758595AFDE299E3E0E5'X      /* E- */
      '30313233343536373839FCEA9AEBE900'X.     /* F- */
   :EEBCASCTBL.


Note: There should only be one EBCASCTBL (EBCDIC-to-ASCII Mapping Table) tag and only one EEBCASCTBL (End EBCDIC-to-ASCII Mapping Table) tag in the WSCST source code. If these tags already exist in the source code, then any new EBCASCTBLE (EBCDIC-to-ASCII Mapping Table Entry) tags should be added immediately before or immediately after the existing EBCASCTBLE tags (and between the existing EBCASCTBL and EEBCASCTBL tags).

Example of Translating the EBCDIC Underscore ('_') Character to an ASCII Double Underscore Character (X'F2')

An Underscore ('_') character is code point X'6D' in EBCDIC Code Page 37. So, to translate an Underscore ('_') character to an ASCII Double Underscore character (X'F2'), the X'6D' position in the table must be changed from its current setting of X'5F' (an Underscore character in ASCII Code Page 850) to X'F2'. This can be done using the following EBCASCTBL (EBCDIC-to-ASCII Mapping Table), EBCASCTBLE (EBCDIC-to-ASCII Mapping Table Entry) and EEBCASCTBL (End EBCDIC-to-ASCII Mapping Table) tags:

:EBCASCTBL.
   :EBCASCTBLE
     EBCDICCP = 37
     ASCIICP  = 850
     DATA =
    /* -0-1-2-3-4-5-6-7-8-9-A-B-C-D-E-F */
      '2020838485A0C68687A4BD2E3C282B7C'X      /* 4- */
      '268288898AA18C8B8DE121242A293BAA'X      /* 5- */
      '2D2FB68EB7B5C78F80A5DD2C25
F23E3F'X      /* 6- */
      '9B90D2D3D4D6D7D8DE603A2340273D22'X      /* 7- */
      '9D616263646566676869AEAFD0ECE7F1'X      /* 8- */
      'F86A6B6C6D6E6F707172A6A791F792CF'X      /* 9- */
      'E67E737475767778797AADA8D1EDE8A9'X      /* A- */
      '5E9CBEFAB8F5F4ACABF35B5DEEF9EF9E'X      /* B- */
      '7B414243444546474849F0939495A2E4'X      /* C- */
      '7D4A4B4C4D4E4F505152FB968197A398'X      /* D- */
      '5CF6535455565758595AFDE299E3E0E5'X      /* E- */
      '30313233343536373839FCEA9AEBE900'X.     /* F- */
   :EEBCASCTBL.


Note: There should only be one EBCASCTBL (EBCDIC-to-ASCII Mapping Table) tag and only one EEBCASCTBL (End EBCDIC-to-ASCII Mapping Table) tag in the WSCST source code. If these tags already exist in the source code, then any new EBCASCTBLE (EBCDIC-to-ASCII Mapping Table Entry) tags should be added immediately before or immediately after the existing EBCASCTBLE tags (and between the existing EBCASCTBL and EEBCASCTBL tags).

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 typed 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).

[{"Product":{"code":"SWG60","label":"IBM i"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":"Print","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"Version Independent;7.1.0;7.1;6.1.1;6.1.0;6.1;5.4.5;5.4.0;5.3.5;5.3.0;5.2.0;5.1.0;4.5.0;4.4.0;4.3.0;4.2.0;4.1.0;3.2.0","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}},{"Product":{"code":"SSC52E","label":"IBM i 7.1"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":" ","Platform":[{"code":"","label":null}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}},{"Product":{"code":"SSC3X7","label":"IBM i 6.1"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":" ","Platform":[{"code":"","label":null}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}}]

Historical Number

8693431

Document Information

Modified date:
18 December 2019

UID

nas8N1010136