Finding the CCSID values of your data sources

Before you can specify appropriate CCSID values to DB2®, you must know the CCSID values that are in effect for all of your data sources. Determining these CCSID values is the first step to preserving data integrity.

About this task

You should know the CCSIDs of all the data that DB2 handles, including all input and output sources, such as the following sources:

  • local input and output devices, such as your 3270 terminal emulators and printers
  • tape data
  • source and data from your application, which are handled by either the DB2 precompiler or a compiler and the DB2 coprocessor
  • data from gateway products, such as WebSphere® MQ, IMS™ Connect, CICS® Transaction Gateway and any third party products
  • FTP data
  • Any data from a distributed environment

Procedure

To find the CCSID values of your data sources:

Use the resources in the following table:
Table 1. How to find the CCSID of your data source
Source Where find the CCSID in effect
Application data (in host variables or parameter markers) Look at the value of the ENCODING bind option unless that value was overridden. For more details about how this option could have been overridden, see Specifying a CCSID for your application.
C/C++ application source code Look at the DB2 precompiler or compiler listing for the CCSID options that were used. For example, the following listing for the DB2 precompiler shows that the application uses CCSID 1047:
OPTIONS USED - SPECIFIED OR DEFAULTED
APOST
APOSTSQL
ATTACH(TSO)
CCSID(1047) 
CICS Transaction Gateway

Look at the value of the system initialization parameter CLINTCP.

See the following resources:

COBOL application source code Look at the DB2 precompiler or compiler listing for the CCSID options that were used. For example, the following listing for the DB2 precompiler shows that the application uses CCSID 37:
OPTIONS USED - SPECIFIED OR DEFAULTED
APOST
APOSTSQL
ATTACH(TSO)
CCSID(37) 
FTP

See How can I check my CCSIDs for FTP?.

IMS Look at the terminal emulator CCSID. (Follow the instructions for ISPF or Personal Communications.) IMS uses this CCSID when communicating to DB2 for z/OS.

In IMS Connect, conversion is done by user message exits. Look at those exits for CCSID information. See User exit (EX) ADD command.

ISPF Look at the value of the ISPF session variable ZTERMCID under ISPF option 7.3 - variable settings.
Personal Communications Look at the Host Code-Page session parameter to find the terminal CCSID. See Configuring Sessions (Personal Communications)
PL/I application source code Look at the DB2 precompiler or compiler listing for the CCSID options that were used. For example, the following listing for the DB2 precompiler shows that the application uses CCSID 37:
OPTIONS USED - SPECIFIED OR DEFAULTED
APOST
APOSTSQL
ATTACH(TSO)
CCSID(37)
QMF™ Check your Graphical Data Display Manager (GDDM) code page setting, because QMF uses GDDM to do the display. You can check your GDDM code page setting by looking at the APPCPG parameter, which can be set in one of the following two places:
  • a defaults module that is called ADMADFT
  • a file that is referred to as ADMDEFS.
If no value is specified for APPCPG, GDDM uses a default CCSID of 00351. For more information about APPCPG, see External defaults: full descriptions .
Recommendation: For QMF, set the APPCPG parameter to match the CCSID that is used by DB2 and your terminal emulator.
Queue Managers in WebSphere MQ

Follow the instructions for viewing and setting the Queue Manager CCSID in Data Conversion under WebSphere MQ.

You can also check individual MQGET and MQPUT statements. These statements can override the MQ CCSID setting by specifying a CCSID in the statement.

TSO Perform one of the following actions:
z/OS DFSMS SMS (the file system)

CCSID is an attribute of SMS-managed data sets. For more information about how that CCSID is set, see Data Conversion for z/OS Distributed FileManager or Converting data for z/OS Network File System or search the CCSID file tagging information in z/OS UNIX System Services Command Reference.

However, the access methods (VSAM, BSAM/QSAM, BPAM, etc) for these data sets do not have support to perform conversions. Only DFM supports conversions between CCSIDs for DASD data sets.

The CCSID value also can be used when reading or writing magnetic tapes that have ISO/ANSI tape labels. You can code the CCSID keyword on the DD statement or supply it in the data class. You can also supply the CCSID value on the JOB or STEP JCL statement. For more information, see Character Data Conversion.