Source program character set

See the following list of the basic source character sets that are available at both compile time and run time:
  • The uppercase and lowercase letters of the English alphabet:

    a b c d e f g h i j k l m n o p q r s t u v w x y z

    A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

  • The decimal digits:

    0 1 2 3 4 5 6 7 8 9

  • The following graphic characters:

    ! " # % & ' ( ) * + , - . / : ; < = > ? [ \ ] _ { } ~

    • The caret (‸) character in ASCII (bitwise exclusive OR symbol) or the equivalent not (¬) character in EBCDIC
    • The split vertical bar character in ASCII, which may be represented by the vertical bar (|) character on EBCDIC systems .
  • The space character
  • The control characters representing new-line, horizontal tab, vertical tab, form feed, end of string (NULL character), alert, backspace, and carriage return.

IBM extension Depending on the compiler option, other specialized identifiers, such as the dollar sign ($) or characters in national character sets, may be allowed to appear in an identifier.

Begin z/OS onlyIn a source file, a record contains one line of source text; the end of a record indicates the end of a source line.

If you use the #pragma filetag directive to specify the encoding of input files, the compiler converts this encoding to the encoding defined by code page IBM-1047. If you use the LOCALE to specify the encoding for output, the compiler converts the encoding from code page IBM-1047 to the encoding you have specified. These conversions apply to:
  • Listings that contain identifier names and source code
  • String literals and character constants that are emitted in the object code
  • Messages generated by the compiler
They do not apply to source-code annotation in the pseudo-assembly listings.

Therefore, the encoding of the following characters from the basic character set may vary between the source-code generation environment and the runtime environment:

! # ' [ ] \ { } ~ ‸ |

For a detailed description of the #pragma filetag directive and the LOCALE option, refer to the description of globalization, locales, and character sets in the z/OS® XL C/C++ User's Guide.End z/OS only