Get Related Default CCSID (CDRGRDC, QTQGRDC) API


  Required Parameter Group:

1 CCSID1 Input Int(4)
2 ESIN Input Int(4)
3 SEL Input Int(4)
4 CCSIDR Output Int(4)
5 FB Output Feedback

  Default Public Authority: *USE

  Threadsafe: No

A given CCSID may not be directly usable in many situations. The Get Related Default CCSID (CDRGRDC, QTQGRDC) API allows the caller to get a nearest equivalent or best-fit related CCSID. The caller supplies an ES value as an additional key to select the appropriate related CCSID.

Authorities and Locks

None.


Required Parameter Group

CCSID1
INPUT; INT(4)

This variable contains the CCSID value referenced, a positive number in the range 1 to 65,533.

ESIN
INPUT; INT(4)

This variable contains the ES value referenced; a positive number in the range 4352 to 65,534.

SEL
INPUT; INT(4)

This variable is reserved to identify any specific selection criteria as additional input. For example, to select among two equally valid related defaults.

SEL Meaning
0 Installation default

CCSIDR
OUTPUT; INT(4)

This variable contains the returned CCSID value; a positive number in the range 1 to 65,533. If no related default is found, CCSIDR is set to CCSID1.

FB
OUTPUT; FEEDBACK

The function returns, in this feedback array, the processing status (and any associated reason) for this function the field type is array of three 32-bit two's complement binary values (12 bytes, or 96 bits); the status code is a non-negative number in the second 16 bits, and the reason code is a non-negative number in the second 16 bits. The following are specific meanings of the status code and associated reason code values (in hexadecimal) contained in the first 32 bits of FB:


Feedback Codes and Conditions

Status Reason Meaning
0000 0000 The function completed successfully.
0001 0001 No entry was found in the Related Default CCSID Table (RDCT) resource for the CCSID1, ESIN, and SEL combination specified. CCSID1 value is copied and returned in CCSIDR.
0002 0001 CCSID1 value is 0, which is reserved for indicating a default in a hierarchy. It must be resolved before this function is called.
0003 0001 CCSID1 is 65,535.
0005 0001 The value of SEL specified is not supported.
0006 0001 The RDCT resource was not found.
0006 0002 The RDCT resource is currently unavailable.
0007 0001 The system RDCT resource accessed by the function is found to be incorrect in the structure.
0008 0001 CCSID1 value is not in the range 0 to 65,635.
0008 0002 ESIN value is not in the range 4352 to 65,534. The CCSID1 value is copied and returned in CCSIDR.
0008 000B SEL value is not in the range 0 to 255.


Usage Notes

  1. CCSID is not locally supported:

    A given CCSID is not one of the supported CCSIDs in that environment. For example, a system that supports only EBCDIC CCSIDs may be serving a PC user, where all the data generated is in one of the PC CCSIDs. A DB2® for IBM® i database server that receives the SQL statement CREATE TABLE from the PC user may not be able to create a table in any other CCSID than an EBCDIC CCSID supported in that installation. Before the table creation is completed, a CCSID value is needed to identify the table's CCSID. Any data from the PC that is placed in this table is converted to this CCSID. However, a selection from the locally supported CCSIDs of a single CCSID that can preserve the maximum number of PC graphic characters is needed. If the user does not supply this CCSID, the system defaults to a CCSID.

    This function gets a CCSID that is predetermined to be the best fit. An ES value is supplied as a key to identify the local environment's needs or characteristic.

  2. CCSID to match a specific data type is needed:

    In a situation where a given CCSID is incompatible with the data type (for example, SBCS CCSID and graphic data type), and a group of CCSIDs (one for each of SBCS, DBCS, and mixed SB/DB encoding schemes) are used, it is necessary to pick the correct CCSID that matches the data type.

    Most CCSIDs registered to date have only one CCSID per data type and ES match. Such CCSIDs share one or more CS and CP values among them, and differ only on the ES ID values. However, since some CS and CP values can be shared between different CCSIDs (with the same ES), more than one CCSID can qualify to be used.

    For example, the CS, CP (00370, 00300) of DBCS Japanese Host CCSID 00300 is used in CCSID 05026 (with SBCS Katakana Extended CS 01172, CP 00290) and in CCSID 05035 (with SBCS Latin Extended CS 01172 and CP 01027). If only DBCS CCSID 00300 was specified, both the CCSIDs 05026 and 05035 qualify to be a related mixed CCSID. Also, both the SBCS CCSIDs 00290 and 01027 qualify to be the related SBCS CCSID.

    However, a single default value selected from the multiple possible CCSIDs is predetermined and made available as a related default CCSID. This function gets this predetermined default for the caller-supplied CCSID value. The defaults are arranged with ES as the key to properly match the data type needed by the caller.


API introduced: V2R2

[ Back to top | National Language Support APIs | APIs by category ]