1.
Data: Begin of w_char,
Ascii type x,
End of w_char.
Move 'A' to w_char.
Write :/ w_char-Ascii. "41
Move 66 to w_char-Ascii. "42
Write :/ w_char. "B
2.
** 字母到ASCII
DATA : c.
FIELD-SYMBOLS : <n> TYPE x.
DATA : rn TYPE i.
c = 'A'.
ASSIGN c TO <n> CASTING.
MOVE <n> TO rn.
WRITE rn. "65
*** ASCII到字母
DATA : i TYPE i VALUE 66.
DATA : x TYPE x.
FIELD-SYMBOLS : <fc> TYPE c.
MOVE i TO x.
ASSIGN x TO <fc> CASTING TYPE c.
MOVE <fc> TO c. "B
WRITE c.
//possibly used by the operating system