The impact of code pages on special characters

When code pages are used the core characters A to Z and 0 to 9 are displayed as they are, while special characters, for example the at sign (@), are mapped to characters that depend on the code page applied. This means that a program compiled and documented in a native code page will have some characters represented in a different way when it is used with another code page.

Special characters in different code pages shows how the at sign (@), exclamation mark (!), and number sign (#) are represented in different code pages. Hence when WAPL is used with the German code page 1141, a line of code referring to a variable would display as follows:
DISPLAY “Application ÜOADID”
Table 1. Special characters in different code pages
Character (US and UK code pages)

EBCDIC
code (US and UK code pages)

OPTIONS keyword German code page (1141) Sweden code page (1143) Italian code page (1144)

Spanish
code page (1145)

French code page (1147)
At sign (@) 7C CHARAT § Ö § @ à
Exclamation mark (!) 5A CHARBANG Ü é ] §
Number sign (#) 7B CHARHASH # Ä Ñ

To see how each character is displayed in your local code page, issue the SHOW OPTIONS command.

Regardless of the code page, you can reassign the symbol to use for the at sign (@), exclamation mark (!), and number sign (#) by using the commands OPTIONS CHARAT, OPTIONS CHARBANG, and OPTIONS CHARHASH respectively. These commands enable you to choose the character to display, sometimes even the same character as the one used in the native code page.

For example, issuing the command OPTIONS CHARAT(@) with the German code page 1141 would reassign the character code 5B (which in code page 1141 corresponds to @) to the character that WAPL uses as @ in its native code page.

Characters whose symbol cannot be overridden shows the characters for which the commands OPTIONS CHARAT, OPTIONS CHARBANG, and OPTIONS CHARHASH cannot be used, because these are reserved characters in the REXX compiler.

Table 2. Characters whose symbol cannot be overridden
Character Code (US and UK code pages) Purpose in REXX
space 40 Space, key text delimiter
( 4D Open parenthesis
+ 4E Mathematical operator
| 4F REXX string concatenation character and Boolean OR
50 REXX Boolean AND
$ 5B Used for internal purposes
) 5D Close parenthesis
¬ 5F Boolean not
_ 6D Used for internal purposes
' 7D Single quote
= 7E Mathematical operator
" 7F Double quote
A to I C1 to C9 Alphabetic characters
J to R D1 to D9 Alphabetic characters
\ E0 Boolean NOT
S to Z E2 to E9 Alphabetic characters
0 to 9 F0 to F9 Numeric characters

For example, in the German code page 1141 the exclamation mark (!) is assigned to EBCDIC code 4F which REXX already uses for both text string concatenation and the OR Boolean operator. Therefore, the command OPTIONS CHARBANG(!) cannot be issued with this code page.

Other symbols not listed in Characters whose symbol cannot be overridden might be incompatible with REXX expressions that are interpreted by WAPL statements. If you find these characters, consider to write the expression without them, or reassign the commands OPTIONS CHARAT, OPTIONS CHARBANG, and OPTIONS CHARHASH before the impacted line, to avoid the incompatibility.