Language compilers CCSID

Some language compilers expect syntactical operators and the naming convention for the source code to be in CCSID 00037. You can refer to the documentation for the language compiler you use.

For these compilers, incorrect mapping occurs if the source is compiled with a CCSID other than 00037 or 65535. You must ensure that these compilers receive any variant characters used in language syntax in CCSID 00037.

ILE language compilers

When compiling an ILE C/400®, ILE RPG for iSeries™, or ILE COBOL for iSeries program, source from database source files is converted to the CCSID of the primary source file.

Compilers for these languages can handle syntactical operators in most CCSIDs. These compilers can also handle naming conventions for the source code in most CCSIDs.

Non-ILE language compilers

When compiling a non-ILE CL, RPG, or COBOL program, source from database source files is converted to the CCSID of the job.

If you do not want your names, constants, or literals converted to the CCSID of the job, you can change your job CCSID to 65535. Your constants, literals and names then remain intact.

Note: REXX/400 procedures and the literal data coded within them are not converted to the job CCSID.

Example 1

The following example shows a sample non-ILE RPG program. This example shows English source on a system in the United States.

*  RPG Source   (Source file created using CCSID 00037 but tagged
*                with CCSID 65535)
FFILE1  IF  E                    DISK                          80
C                     READ FILE1
C* Test char
C*
C           FLD1      IFEQ '$'
C                     ...
C* Move char
C*
C                     MOVE FLD1         FLD$
C                      ...
C*
C                     SETON                                   LR

Example 2

In Finland, the program in the first example does not compile because the field name FLD$ contains a variant character (the dollar sign). The variant character represents a different code point in a code page other than 00037. This figure shows the same sample non-ILE RPG program as English (U.S.) source on a system in Finland (CCSID 278).

*  RPG Source   (Source file created with CCSID 00037, but tagged
*                with 65535)
FFILE1  IF  E                    DISK                          80
C                     READ FILE1
C* Test char
C*

C FLD1 IFEQ ' a ring character '

C                     ...
C* Move char
C*

C MOVE FLD1 FLD a ring character

C                      ...
C*
C                     SETON                                   LR

Example 3

You can correct this error by changing the file CCSID to 00037 and setting the job CCSID to 00278 (for Finland). The following example shows the changed file as seen English source in Finland.

*  RPG Source   (Source file created using CCSID 00037 and tagged
*                with CCSID 00037)
FFILE1  IF  E                    DISK                          80
C                     READ FILE1
C* Test char
C*
C           FLD1      IFEQ '$'
C                     ...
C* Move char
C*
C                     MOVE FLD1         FLD$
C                      ...
C*
C                     SETON                                   LR