Using the RECEIVE Table for ASCII to EBCDIC Translation

To convert a character from ASCII to EBCDIC, you can simply get the HEX representation of that character in ASCII and EBCDIC.

Procedure

  1. Take the ASCII HEX representation of the ASCII character.
  2. Look that many bytes into the RECEIVE table, and place the HEX representation of the EBCDIC character in the correct entry in the table.
    Note: The displacements in the table start at 0, and there are two characters in the table for each actual byte of data.

    For example: number 1 in ASCII is X'31', and in EBCDIC is X'F1'.

    In the RECEIVE table, if you go to displacement 31, you can go to the fourth line in the RECEIVE table, and the second pair in the line, you can get the character F1, which is the EBCDIC representation of the ASCII character 1.