iSeries server support

The default CCSID for a job on the iSeries™ server is specified using the Change Job (CHGJOB) command.

If a CCSID is not specified in this way, the job CCSID is obtained from the CCSID attribute of the user profile. If a CCSID is not specified on the user profile, the system gets it from the QCCSID system value. This QCCSID value is initially set to 65535. If your server is in a distributed relational database with unlike systems, it might not be able to use CCSID 65535.

All control information that flows between the application requester (AR) and application server (AS) is in CCSID 500 (a DRDA® standard). This is information such as collection names, table names, and some descriptive text. Using variant characters for control information causes these names to be converted, which can affect performance. Package names are also sent in CCSID 500. Using variant characters in a package name causes the package name to be converted. This means the package is not found at run time.

After a job has been initiated, you can change the job CCSID by using the Change Job (CHGJOB) command. To do this:

  1. Enter the Work with Job (WRKJOB) command to get the Work with Jobs display.
  2. Select option 2 (Display job definition attributes). This locates the current CCSID value so you can reset the job to its original CCSID value later.
  3. Enter the Change Job (CHGJOB) command with the new CCSID value.

The new CCSID value is reflected in the job immediately. However, if the job CCSID you change is an AR job, the new CCSID does not affect the work being done until the next CONNECT.

Attention: If you change the CCSID of an AS job, the results cannot be predicted.

Source files are tagged with the job CCSID if a CCSID is not explicitly specified on the Create Source Physical File (CRTSRCPF) or Create Physical File (CRTPF) command for source files. Externally described database files and tables are tagged with the job CCSID if a CCSID is not explicitly specified in data description specification (DDS), in interactive data definition utility (IDDU), or in the CREATE TABLE SQL statement.

For source and externally described files, if the job CCSID is 65535, the default CCSID based on the language of the operating system is used. Program described files are tagged with CCSID 65535. Views are tagged with the CCSID of its corresponding table tag or column-level tags. If a view is defined over several tables, it is tagged at the column level and assumes the tags of the underlying columns. Views cannot be explicitly tagged with a CCSID. The system automatically converts data between the job and the table if the CCSIDs are not equal and neither of the CCSIDs is equal to 65535.

When you change the CCSID of a tagged table, it cannot be tagged at the column level or have views defined on it. To change the CCSID of a tagged table, use the Change Physical File (CHGPF) command. To change a table with column-level tagging, you must create it again and copy the data to a new table using FMT(*MAP) on the Copy File (CPYF) command. When a table has one or more views defined, you must follow these steps to change the table:

  1. Save the view and table along with their access paths.
  2. Delete the views.
  3. Change the table.
  4. Restore the views and their access paths over the created table.

Source files and externally described files migrated to DB2 Universal Database™ for iSeries that are not tagged or are implicitly tagged with CCSID 65535 will be tagged with the default CCSID based on the language of the operating system installed. This includes files that are on the system when you install a new release and files that are restored to DB2® UDB for iSeries.

All data that is sent between an AR and an AS is sent not converted. In addition, the CCSID is also sent. The receiving job automatically converts the data to its own CCSID if it is different from the way the data is tagged. For example, consider the following application that is run on a dealership system, KC105.

Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.
CRTSQLxxx PGM(PARTS1) COMMIT(*CHG)  RDB(KC000)
 
    PROC: PARTS1;
       .
       .
    EXEC SQL
      SELECT * INTO :PARTAVAIL
               FROM INVENTORY
               WHERE ITEM = :PARTNO;
       .
       .
    END PARTS1;

In the preceding example, the local system (KC105) has the QCCSID system value set at CCSID 37. The remote regional center (KC000) uses CCSID 937 and all its tables are tagged with CCSID 937. CCSID processing takes place as follows:

Related concepts
User FAQs
Related reference
Change Job (CHGJOB) command
Change Physical File (CHGPF) command
Copy File (CPYF) command
Create Physical File (CRTPF) command
Create Source Physical File (CRTSRCPF) command
Work with Job (WRKJOB) command