[Top] [Prev] [Next] [Bottom]

Changing Printer Characters


Host sessions send data to IntranetWare HostPrint in EBCDIC format. HostPrint converts the data from an EBCDIC data stream to an ASCII data stream, which it sends as a print job to a NetWare print queue. The translation of data from EBCDIC to ASCII is a two-step process:

1. Host data in EBCDIC is translated to a special internal code, known as "buffer code." (Unlike EBCDIC and ASCII, buffer code is an invariant reference code: it does not change from one country to another.) HostPrint uses translation tables from the files named ECPnnn.XLT, where nnn represents the EBCDIC code page number to be used in the translation.

2. When the data is to be sent to the print queue, the buffer code data is translated to ASCII. HostPrint uses translation tables from the files named ACPnnn.XLT, where nnn represents the ASCII code page number to be used in the translation.

This appendix describes the ECPnnn.XLT and ACPnnn.XLT files and how to edit them. Novell's buffer codes are shown in Figure E-1.

To change printer characters, you must modify the ASCII code page file that HostPrint uses when preparing print jobs. Normally, you would not modify the EBCDIC code page file unless your mainframe sends data in an EBCDIC code page that supports a language or country different from the ones supported by the EBCDIC code page files provided by Novell. The extended character sets supported by ASCII printers vary widely, however, so you may need to produce a custom ASCII code page file to support a particular pr inter.

Figure E-1
NetWare 3270 Buffer Code Chart

ECPnnn.XLT Files

In order to translate from EBCDIC into buffer codes, HostPrint uses files named ECPnnn.XLT, where nnn represents the EBCDIC code page number. Table E-1 shows the structure of the ECPnnn.XLT files.

Table E-1
ECPnnn.XLT Translation File Structure


Offset (hex)

Length (dec)

Description

000

192

3270 buffer codes to EBCDIC codes.

0C0

256

EBCDIC codes to 3270 buffer codes.

1C0

24

Bit map of historically valid EBCDIC code points. The bit map is ordered from left to right within each byte. This table is used only by NetWare 3270 KEYDEF to highlight EBCDIC code points that may not be supported by a host application.

HostPrint uses only the structure at offset 0C0 (3270 buffer code indexed by EBCDIC code value).

ACPnnn.XLT Files

In order for the printer to prepare a print job, HostPrint must convert buffer codes to ASCII values. It does so using the ASCII code page files ACPnnn.XLT, where nnn represents the ASCII code page number.
Table E-2 shows the structure of the ACPnnn.XLT files.

Table E-2
ACPnnn.XLT Translation File Structure


Offset (hex)

Length (dec)

Description

000

256

3270 buffer codes to ASCII codes.

100

256

ASCII codes to 3270 buffer codes.

HostPrint uses only the structure at offset 000 (ASCII code indexed by 3270 buffer code value).

The section "Editing .XLT Files" below provides a general procedure for editing .XLT files and uses the modification of ACP437.XLT as an example.

ASCII code pages 100 and 850 are the only Latin-based ASCII code pages that can be mapped to and from buffer codes without any compromises. All other Latin-based ASCII code page translation tables contain some substitute mappings; that is, some characters do not print correctly. For example, an accented letter may print without the accent mark.

However, ASCII code pages other than 100 and 850 are useful for countries that do not require accented characters. For example, though ASCII code page 437 can be used satisfactorily in most countries, it cannot be used in Canada, Denmark, Norway, or Portugal.

The buffer code F1 hex is used to print invalid characters. F1 hex is usually translated to the ASCII hyphen character (-). However, you can change the ASCII code at location F1 hex (in the ACPnnn.XLT file) to print invalid characters differently without changing actual hyphens.

With LU3 sessions, the control program translates hex 3F (EBCDIC SUB format control order) to buffer code hex F7. Novell ACPnnn.XLT files translate buffer code hex F7 to hex DC. Hex DC prints as a "blob" character in the ASCII code pages supported.

Editing .XLT Files

The .XLT files are in binary format. The following examples show how to modify these files.

Example 1

This example shows you how to modify the file ACP437.XLT, so that all invalid characters (invalid control codes and unsupported printable characters, such as APL graphics) will be translated to the ASCII "ESC" code (hex 1B). This modification will work for both LU1 and LU3 sessions, provided that the sessions are configured to allow invalid codes (see the Return an Op Check configuration options in CSCON). However, this modification is of practical value primarily for LU3 sessions. For LU1 sessions, the preferred method for sending ASCII control codes (such as "ESC") is to send them in an SCS "transparent data" command string-but that method is not available in LU3 sessions.

1. Refer to the NetWare 3270 buffer code chart (see Figure E-1) if you intend to edit an ACPnnn.XLT file.
In this case, you must modify the ASCII code to which buffer code F1 hex is mapped (because all invalid EBCDIC control codes are normally translated to buffer code F1 hex).
2. Using a binary file editor such as DEBUG, open a copy of the file you want to edit. Enter the following command:
debug filename.ext
Replace filename.ext with the name of the file you want to edit.
For example, to open a temporary copy of ACP437.XLT, enter
copy acp437.xlt acp437.tmp
debug acp437.tmp
The prompt changes to a dash (-).
3. Edit the table entries in the file.
To change a table entry using DEBUG, follow the procedure below.

3a. Note the offset of the entries within the file.

When using DEBUG, you must add hex 100 to the offset of any entry you wish to display or modify.

In this procedure, you wish to change the ASCII code value at offset F1 hex. Adding hex 100 results in a DEBUG offset address of 1F1.

3b. Display table entry data on screen using the DEBUG DUMP command.

Enter the following command:

dump x ly

Replace x with the address of the data you wish to view and y with the number of bytes you wish to view.

To view the ASCII code at offset F1 hex, enter

dump 1f1 l1

DEBUG displays the table entry's contents as shown in Figure E-2. The right side of the DEBUG display showing ASCII equivalents indicates that the value 2D hex is the ASCII code for -.

Figure E-2
DEBUG Display before Editing


-d 1f1 l1

3E72:01F0 2D -

-


To change the table entry, use the DEBUG ENTER command as follows:

enter x y

Replace x with the address of the data you wish to modify (the table entry's hex offset plus hex 100). Replace y with the hex value you want to store at that location.

To change the ASCII code for - to the ASCII "ESC" code, enter the following:

enter 1f1 1b

3c. To view the changes you made, use the DUMP command again.

To view the changes made at offset F1 hex, type

dump 1f1 l1

The last two commands and the resultant DUMP display are shown in Figure E-3.

4. After you have finished editing the file, save your changes. Use the DEBUG WRITE command to write your changes to the file and the DEBUG QUIT command to exit from DEBUG.
See Figure E-3.

Figure E-3
DEBUG Display: Editing and Saving


-e 1f1 1b

-d 1f1 l1

3E72:01F0 1B .

-w

Writing 00200 bytes

-q


Example 2

This example shows you how to modify the file ACP437.XLT, so that the EBCDIC code for ³, which is rarely used, will be translated to the ASCII "ESC" code (hex 1B). This modification will work for both LU1 and LU3 sessions. However, it is of practical value primarily for LU3 sessions. For LU1 sessions, the preferred method for sending ASCII control codes (such as "ESC") is to send them in an SCS "transparent data" command string-but that method is not available in LU3 sessions.

1. Refer to the NetWare 3270 buffer code chart (see Figure E-1) if you intend to edit an ACPnnn.XLT file.
In this case, the buffer code for ³ is 07 hex. No modification to the EBCDIC translation table (in the ECPnnn.XLT file) is necessary, because all EBCDIC translation table files map the ³ character to buffer code 07 hex. (All of the ECPnnn.XLT files supplied with HostPrint map the EBCDIC code FA hex to the ³ character buffer code-so your mainframe application would need to send FA hex to take advantage of this remapping of ³ to the ASCII "ESC" code.)
2. Using a binary file editor such as DEBUG, open a copy of the file you want to edit. Enter the following command:
debug filename.ext
Replace filename.ext with the name of the file you want to edit. See Example 1 for details.
3. Edit the table entries in the file.
To change a table entry using DEBUG, follow the procedure below.

3a. Note the offset of the entries within the file.

When using DEBUG, you must add hex 100 to the offset of any entry you wish to display or modify.

In this procedure, you wish to change the ASCII code value at offset 07 hex. Adding hex 100 results in a DEBUG offset address of 107.

3b. Display table entry data on screen using the DEBUG DUMP command.

Enter the following command:

dump x ly

Replace x with the address of the data you wish to view and y with the number of bytes you wish to view.

To view the ASCII code at offset 07 hex, enter

dump 107 l1

DEBUG displays the table entry's contents as shown in Figure E-4. The value 33 hex is the ASCII code for ³ in the ASCII code page 437 translation table (ASCII code page 437 does not contain a superscript 3 character, so the ACP437.XLT file substitutes a 3).

To change the table entry, use the DEBUG ENTER command as follows:

enter x y

Replace x with the address of the data you wish to modify (the table entry's hex offset plus hex 100). Replace y with the hex value you want to store at that location.

To change the ASCII code for ³ to the ASCII "ESC" code, enter the following:

enter 107 1b

3c. To view the changes you made, use the DUMP command again.

To view the changes made at offset 07 hex, type

dump 107 l1

The last two commands and the resultant DUMP display are shown in Figure E-4.

4. After you have finished editing the file, save your changes. Use the DEBUG WRITE command to write your changes to the file and the DEBUG QUIT command to exit from DEBUG.
See Figure E-4.

Figure E-4
DEBUG Display: Displaying, Editing, and Saving ACP437.XLT File


-d 107 l1

3E72:0100 33 3

-e 107 1b

-d 107 l1

3E72:0100 1B .

-w

Writing 00200 bytes

-q


Example 3

This example shows you how to modify the ECP037.XLT file and the ACP437.XLT file, so that the EBCDIC "ESC" code (hex 27) will be translated to the ASCII "ESC" code (hex 1B). This modification will work for LU3 sessions only, provided that the sessions are configured to allow invalid codes (see the Return an Op Check configuration options in CSCON). For LU1 sessions, all invalid EBCDIC control codes (such as "ESC") are translated to buffer code F1 hex, and this cannot be changed by modifying the ECP nnn.XLT file. For LU3 sessions, however, invalid EBCDIC control codes can be individually translated by the EBCDIC-to-buffer code table in the ECPnnn.XLT file.

1. Obtain an EBCDIC code chart if you intend to edit an ECPnnn.XLT file. Refer to the NetWare 3270 buffer code chart (see Figure E-1) if you intend to edit an ACPnnn.XLT file.
In this case, you need to pick a buffer code into which to map the EBCDIC "ESC" code (hex 27). A good choice is 07 hex, the buffer code for ³, because this character is rarely used. Your EBCDIC code chart should show that the EBCDIC code for the ³ character is FA hex. Since you are changing the ECP037.XLT file to map 27 hex to buffer code 07 hex, and FA hex is already mapped to that buffer code, it will turn out that either EBCDIC code (27 hex or FA hex) will produce the ASCII "ESC" code.

To individually translate an invalid EBCDIC control code, you must choose a buffer code value above hex 05 and below hex 30. In an LU3 session, any EBCDIC control code that is mapped to a buffer code value of hex 05 or below is processed as a format control order (such as NL, FF, or EM); furthermore, any invalid EBCDIC control code that is mapped to a buffer code value of hex 30 or above is specially translated to the "invalid character" buffe r code F1 hex (or, in certain cases, to special internal codes for the FM, DUP, or SUB characters).

In the ECPnnn.XLT translation table files supplied with HostPrint, the invalid EBCDIC control codes are all mapped to buffer code hex 31. Thus, they will all be specially translated to hex F1 (which, in turn, is normally translated to an ASCII hyphen by the ACPnnn.XLT table before it is sent to a NetWare print queue).

2. Using a binary file editor such as DEBUG, open a copy of the file you want to edit. Enter the following command:
debug filename.ext
Replace filename.ext with the name of the file you want to edit.
For example, to open a temporary copy of ECP037.XLT, enter
copy ecp037.xlt ecp037.tmp
debug ecp037.tmp
The prompt changes to a dash (-).
3. Edit the table entries in the file.
To change a table entry using DEBUG, follow the procedure below.

3a. Note the offset of the entries within the file.

When using DEBUG, you must add hex 100

3b. to the offset of any entry you wish to display or modify.

In this procedure, you wish to change the buffer code value at offset 0C0+27 hex (because the EBCDIC-to-buffer code translation table starts at offset 0C0 in the ECP037.XLT file). Adding hex 100 results in a DEBUG offset address of 1E7 (= 100+0C0+27).

3c. Display table entry data on screen using the DEBUG DUMP command.

Enter the following command:

dump x ly

Replace x with the address of the data you wish to view and y with the number of bytes you wish to view.

To view the buffer code at offset E7 hex, enter

dump 1e7 l1

DEBUG displays the table entry's contents as shown in Figure E-5. The value 31 hex is the buffer code for -. The right side of the DEBUG display (showing ASCII equivalents) displays "1" because 31 hex also happens to be the ASCII code for the number 1.

To change the table entry, use the DEBUG ENTER command as follows:

enter x y

Replace x with the address of the data you wish to modify (the table entry's hex offset plus hex 100). Replace y with the hex value you want to store at that location.

To change the buffer code for EBCDIC hex 27 to 07 hex (the buffer code for ³), enter the following:

enter 1e7 07

3d. To view the changes you made, use the DUMP command again.

To view the changes made at offset E7 hex, type

dump 1e7 l1

The last two commands and the resultant DUMP display are shown in Figure E-5.

4. After you have finished editing the file, save your changes. Use the DEBUG WRITE command to write your changes to the file and the DEBUG QUIT command to exit from DEBUG.
See Figure E-5.

Figure E-5
DEBUG Display: Displaying, Editing, and Saving ECP037.XLT File


-d 1e7 l1

3E72:01E0 31 1

-e 1e7 07

-d 1e7 l1

3E72:01E0 07 .

-w

Writing 001D8 bytes

-q


5. Make the same change to the ACP437.XLT file that is shown in Example 2 on page E-7.
If you choose a buffer code value other than 07 hex, modify the procedure in Example 2 accordingly.


[Top] [Prev] [Next] [Bottom]

usib2hpd@vnet.ibm.com
Copyright © Novell, Inc. and International Business Machines Corporation 1998. All rights reserved.