IBM Support

Printing Subscript or Superscript to an ASCII Printer

Question & Answer


Question

It is possible to print subscript, such as H20, or superscript, such as 1st, to an ASCII printer?

Cause

Our technical documentation includes chemical elements and equations that require the use of subscript and superscript when printing.

Answer


**IMPORTANT**
The information contained in this document is not guaranteed to work and may not work.  The function of printing subscript and superscript is dependent on the printer hardware.  

The instructions are for physically printing the spooled file to an ASCII printer.   It is not possible to print subscript or superscript on a LAN-attached IPDS printer.  The subscript and superscript will not be included in a PDF file created by Transform Services (5770TS1), Infoprint Server (5722IP1), or any third party application using IBM APIs to create a PDF file.

The instructions and information in this document are provided as-is.  It is a high level overview of what is required.  In depth assistance is outside the realm of support provided by IBM support and can be provided through IBM i Customized Services.


There are several requirements to print subscript and superscript to an ASCII printer from the IBM i.

1)  The printer file used to generate the spooled file must be *SCS and Unprintable Character Action (RPLUNPRT) as *NO.  Subscript and superscript are SCS controls and will not be recognized in an AFPDS data stream.

2)  Programming is necessary to identify which data will be printed as sub/superscript.  The hex SCS control is x'38' for subscript and x'09' for superscript. Subscript is ended by superscript and superscript is ended by  subscript. There is no DDS support for  superscript and subscript.  An example variable in RGPLE might be:
@FIRST = '1' + x'09' + 'ST' + x'38';
@WATER = 'H' + x'38' + '2' + x'09' + 'O';

3)  There are two characters available in code page 37 that look like superscript. These are image 9056.  If the printer hardware is using code page 437, a Workstation Customizing Object (WSCST) is necessary to map superscript code points from code page 37 to 437.  Both code pages 37 and 437 contain the subscript and superscript characters, but at different code points.  Code page 37 contains Superscript 2 at code point X'EA' and Superscript 3 at code point X'FA'.  These map to X'00' on code page 437, which is NULL.

Documents for reference:

Retrieve the source for the appropriate WSCST object.
Modify the EBCDIC-to-ASCII Mapping Table Entry (EBCASCTBLE) tag for EBCDIC code page 37 to ASCII code page 437 accordingly:
Map code points X'EA' to X'FD' and X'FA' to X'FC':
: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- */
      'E67E737475767778797AADA84459FDFC'X      /* A- */
      '1B9C9DFA001514ACAB005B5D00DB27DD'X      /* B- */
      '7B41424344454647484900939495A2A7'X      /* C- */
      '7D4A4B4C4D4E4F50515200968197A398'X      /* D- */
      '5CF6535455565758595AFD939995A2DC'X      /* E- */
      '3031323334353637383900969A97A300'X.     /* F- */
   :EEBCASCTBL.

 
Exit and save the changed source and create a WSCST object.  Configure the printer device or remote output queue to use the modified WSCST object.

4)  Depending on what the printer hardware expects for subscript and superscripts command, a Workstation Customizing Object (WSCST) may need to be modified to change the value of the subscript and superscript tags:   STRSUBS, :ENDSUBS, :STRSUPS, and :ENDSUPS.  The existing Manufacturer Type and Models, such as *HPx and *RICOHx have the sub/superscript tags, though the value for the DATA may not be the correct control code for the printer hardware.  If the existing values for these tags do not work, refer to printer hardware documentation or contact the printer manufacturer to learn what values to use.

Document for reference:

For example, the sub/superscript tags in *HP4000 are:
:STRSUBS                  
  DATA ='1B26612B2E3352'X.
:ENDSUBS                  
  DATA ='1B26612D2E3352'X.
:STRSUPS                  
  DATA ='1B26612D2E3352'X.
:ENDSUPS                  
  DATA ='1B26612B2E3352'X.

Function Parameter   Command  
Decimal Value
Hexadecimal
Value
Subscript Down ¼ Row Ec&a+.25R (r) 027 038 097 043 046 050 053 082 (114) 1B 26 61 2B 2E 32 35 52(72)
Superscript Up ¼ Row Ec&a-.25R (r) 027 038 097 045 046 050 053 082 (114) 1B 26 61 2D 2E 32 35 52(72)

If the existing values for *HP4000 do not work, modify a WSCST object to the values from the manufacturer's documentation:
 :STRSUBS                  
  DATA ='1B26612B2E323552'X.
:ENDSUBS                  
  DATA ='1B26612B2E323572'X.
:STRSUPS                  
  DATA ='1B26612D2E323552'X.
:ENDSUPS                  
  DATA ='1B26612D2E323572'X.


[{"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":"7.1.0"}]

Document Information

More support for:
IBM i

Software version:
7.1.0

Operating system(s):
IBM i

Document number:
6436877

Modified date:
30 March 2021

UID

ibm16436877

Manage My Notification Subscriptions