BARR/SPOOL manual

Appendix B. ASCII and EBCDIC Standards

The PC uses the ASCII (American Standard Code for Information Interchange) coding system to define the correspondence between the graphic symbols we see on paper and on screen to the hexadecimal codes manipulated in the computer. By comparison, a mainframe or AS/400 assumes the EBCDIC (Extended Binary-Coded Decimal Interchange Code) coding system between the graphic symbols and the hexadecimal codes used in the computer.

Both the ASCII and EBCDIC standards include control codes that do not have a graphic representation. These codes are used for control functions by printers and communication protocols. The control codes are represented symbolically by two- and three-character abbreviations. For example, the control code for End of Transmission is represented as EOT.

When printing ASCII files on EBCDIC printers, BARR/SPOOL must translate the codes from ASCII to EBCDIC. When printing EBCDIC files on ASCII printers, BARR/SPOOL must translate the files from EBCDIC to ASCII.

The tables in sections B.5 and B.6 show the standard ASCII-to-EBCDIC and EBCDIC-to-ASCII translations. Section 9.1 describes how to modify the standard translation tables.


B.1 Printing ASCII Files on EBCDIC Printers

BARR/SPOOL translates ASCII files to EBCDIC files when printing to S/370 channel attached printers.

Each ASCII line ends with the carriage return character. Line Feed (LF), Form Feed (FF), and Delete (7F) characters are discarded. Horizontal Tab (HT) characters produce the standard spacing assumed by the IBM PC.

BARR/SPOOL translates from the ASCII character set to the EBCDIC character set. See Section B.4 for a description of the ASCII-to-EBCDIC Translation Table.

B.2 Printing EBCDIC Files on ASCII Printers

A mainframe or AS/400 uses the EBCDIC coding system. The data in each line is translated from EBCDIC to ASCII as described in Section B.5, EBCDIC-to-ASCII Translation Table.

Each line received from the host computer provides line feed and carriage control information as described in the following table:

Spacing information received

ASCII codes produced

Space 0 lines

CR (overprint)

Space 1 line

CR LF

Space 2 lines

CR LF CR LF

Space 3 lines

CR LF CR LF CR LF

Skip to stop 1

FF to start new page

Skip to stop 2-9, A, B, C

CR LF

B.3 EBCDIC and ASCII Translation

During data translation, the representation for a symbol in one coding system is converted to the representation for that symbol in the other coding system. In many cases, an identical symbol exists in both coding systems so translation is straightforward. For example, the letter A is represented as hexadecimal 41 in ASCII and C1 in EBCDIC.

In a few cases, an identical symbol does not exist in both coding systems but an equivalent character can be substituted. For example, the EBCDIC Logical Not (¬) symbol is represented by the ASCII circumflex (^), the alternate representation for this symbol.

In other cases, an equivalent symbol does not exist because all graphic symbols do not appear in both the ASCII and EBCDIC coding systems. In these cases, the software substitutes a question mark (?) for the symbols. For example, when converting from EBCDIC to ASCII, the EBCDIC hexadecimal 62 does not have an equivalent representation in ASCII.

The default tables in the BARR/SPOOL program do not translate any control codes. Instead, question marks (?) are substituted for control codes. Translate control codes to Control codes is the default option. The default tables are shown in this appendix. You can alter the translation tables to meet your application’s requirements. Refer to section 9.1 for more information about modifying the translation tables.

Extended ASCII Codes: The translation tables allow you to use extended ASCII codes for 80-FF. On the PC keyboard, extended ASCII characters can be displayed by pressing ALT and the decimal code for the symbol. Refer to the ASCII code pages in your DOS manual for a list of ASCII symbols and their decimal codes.

B.4 ASCII-to-EBCDIC Translation Table

The ASCII codes are defined in the American Standard Code for Information Interchange publication ANSI X3.4-1986 from the American National Standards Institute, Inc., 1430 Broadway, New York, NY 10018.

In the table above, the first column contains ASCII hexadecimal codes that are associated with a graphic or control symbol given in the third column. EBCDIC codes are obtained by matching for the same graphic in the IBM EBCDIC standard. The right half of the table (80-FF) is a copy of the left half (00-7F), which causes the parity bit to be ignored in translation between ASCII and EBCDIC.

B.5 EBCDIC-to-ASCII Translation Table

The EBCDIC codes are defined in the IBM publication, System 370 Reference Summary, GX20-1850.

In the table above, the first column contains EBCDIC hexadecimal codes that are associated with a graphic or control symbol given in the third column. ASCII codes are obtained by matching for the same graphic in the ASCII standard. The double question marks (??) indicate characters which are not available in ASCII. These characters will be translated to an ASCII question mark (?). Two EBCDIC-to-ASCII Tables can control EBCDIC-to-ASCII translation on printer and punch streams. The following list shows how Table 2 differs from Table 1.

If your printer supports these symbols, using Table 2 makes the symbols print on the PC the same way as on a mainframe. Most PC printers support printing these characters.

B.6 Legend of Characters

Characters and symbols which display in the translation tables (B.4 and B.5) are listed below.

Control Characters

Control Characters

ACK

Acknowledge

MFA

Modify Field Attribute

BEL

Bell

NAK

Negative Acknowledge

BS

Backspace

NBS

Numeric Backspace

BYP

Bypass

NL

New Line

CAN

Cancel

NUL

Null

CR

Carriage Return

POC

Program-Operator Communication

CSP

Control Sequence Prefix

PP

Presentation Position

CU1

Customer Use 1

RES

Restore

CU3

Customer Use 3

RFF

Required Form Feed

DC1

Device Control 1

RNL

Required New Line

DC2

Device Control 2

RPT

Repeat

DC3

Device Control 3

RS

Record Separator

DC4

Device Control 4

SA

Set Attribute

DEL

Delete

SBS

Subscript

DLE

Data Link Escape

SEL

Select

DS

Digit Select

SFE

Start Field Extended

EM

End of Medium

SI

Shift In

ENQ

Enquiry

SM

Set Mode

EO

Eight Ones

SO

Shift Out

EOT

End of Transmission

SOH

Start of Heading

ESC

Escape

SOS

Start of Significance

ETB

End of Transmission Block

SPS

Superscript

ETX

End of Text

STX

Start of Text

FF

Form Feed

SUB

Substitute

FS

File Separator

SYN

Synchronous Idle

GE

Graphic Escape

TRN

Transparent

GS

Group Separator

UBS

Unit Backspace

HT

Horizontal Tabulation

US

Unit Separator

IR

Index Return

VT

Vertical Tabulation

IT

Indent Tab

WUS

Word Underscore

LF

Line Feed

 

 

Graphic Characters

Graphic Characters

SP

Space (Normally Nonprinting)

<

Less Than

!

Exclamation Point

=

Equals

"

Quotation Marks (Diaeresis)

>

Greater Than

#

Number Sign

?

Question Mark

$

Dollar Sign

@

Commercial At

%

Percent Sign

A...Z

Uppercase Latin Letters

&

Ampersand

[]

Opening, Closing Bracket

Apostrophe (Closing Single Quotation Mark; Acute Accent)

\

Reverse Slant

(

Opening Parenthesis

^

Circumflex

)

Closing Parenthesis

_

Underline

*

Asterisk

Opening Single Quotation Mark (Grave Accent)

+

Plus

a...z

Lowercase Latin Letters

,

Comma (Cedilla)

{}

Opening, Closing Braces

-

Hyphen (Minus)

¦

Broken Vertical Line

.

Period (Decimal Point)

~

Tilde

/

Slant

˘

Cent (IBM Extension)

0...9

Digits 0 through 9

¬

Logical Not (IBM Extension)

:

Colon

|

Vertical Line (IBM Extension)

;

Semicolon