ILE COBOL Programmer's Guide

Including Copy Members with Different CCSIDs in Your Source File

Your ILE COBOL source program can consist of more than one source file. You can have a primary source file and multiple secondary source files such as copy books and DDS files.

The secondary source files can have CCSIDs that are different from the CCSID of the primary source file. In this case, the contents of the secondary files are converted to the CCSID of the primary source files as they are processed by the ILE COBOL compiler.

CCSID 65535 implies that no conversion of the source file is to take place. If either the primary source file, the secondary source file, or both are assigned CCSID 65535 then no conversion takes place. A syntax error could be reported by the ILE COBOL compiler if the secondary source file contains characters that are not recognized by the character set specified by the CCSID of the primary source file.

When a Format 2 COPY statement is used to incorporate DDS file descriptions into your source program, CCSID conversion does not take place. If the DDS source has a different CCSID than the source member into which it is being copied, then the copied DDS source may contain some characters which are not valid. These characters will be flagged as syntax errors.

If the primary source file and the secondary source files have different CCSIDs and neither is CCSID 65535 then the compile time performance may be impacted. The ILE COBOL compiler must spend time converting the secondary source files from one CCSID to the CCSID of the primary source file. This time may be significant depending on the size of the source files. This is illustrated in the following figure:

Figure 7. Converting Source Files based on CCSID

The primary source has CCSID 37. The copied file has CCSID 285. The program object has CCSID 37.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]