Get Short Form with Maximal CS for Specified ES and CP (CDRSMXC, QTQSMXC) API


  Required Parameter Group:

1 CPIN Input Int(4)
2 ESIN Input Int(4)
3 CCSIDR Output Int(4)
4 ESR Output Int(4)
5 FB Output Feedback

  Default Public Authority: *USE

  Threadsafe: Yes

The Get Short Form with Maximal CS for Specified ES and CP (CDRSMXC, QTQSMXC) API gets the CCSID with the maximal character set (CS) for a given code page (CP) value. The encoding scheme (ES) parameter can be specified to distinguish between usage of the same CP with two different encoding schemes, such as PC Display compared to PC Data.

The function works only with those CCSIDs that have only one (CS, CP) pair associated with them. That is, pure single-byte or pure double-byte CCSIDs (for those registered to date).

The CS element associated with the returned CCSID is the largest in size of all the character sets that are contained in its associated code page in the CCSID resource installed in the system.

Notes:

  1. Not all the registered code pages are full, leaving room for possible future additions. The term maximal is used to distinguish it from a full code page. Over time, when new larger character sets are registered for a code page (this can happen until the code page is full), the maximal character set also changes, leading to a new CCSID returned by this function.

  2. This API does NOT support any mixed or multibyte CCSIDs.

Authorities and Locks

None.


Required Parameters

CPIN
INPUT; INT(4)

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

ESIN
INPUT; INT(4)

This variable contains the ES value referenced;

ESIN Meaning
0 The caller does not know the ES value, and expects the first CCSID encountered in the CCSID repository, with the specified CP and the Full or Maximal CS, to be returned.
Other The caller specifies the ESID value, a positive number in the range 4352 to 65,534. Only ESIDs that have a single (CS, CP) pair associated with them are valid for this function.

CCSIDR
OUTPUT; INT(4)

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

ESR
OUTPUT; INT(4)

This variable contains the ES value of the returned CCSID, a zero or a positive number in the range 4352 to 65,534.

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 first 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, (the other 64 bits are reserved).


Feedback Codes and Conditions

Status Reason Meaning
0000 0000 The function completed successfully
0001 0001 No entry was found in the CCSID resource repository for the specified CPIN, ESIN combination
0001 0003 ESIN was specified as 0. The first CCSID encountered in the CCSID repository, with the specified CP and the "Full" or "Maximal" CS was returned. Additional CCSIDs meeting the criteria may exist.
0001 0009 The ESIN specified indicates that more than one pair of CS, CPs are associated with it, which is incorrect for this function.
0002 0001 CPIN value is 0.
0003 0001 CPIN value is 65,535 (X'0000FFFF').
0006 0001 The CCSID resource repository was not found.
0006 0002 The CCSID resource repository is currently unavailable.
0007 0001 The system CCSID resource repository accessed by the function was found to be incorrect in the structure.
0008 0001 CPIN value is not in the range 0 (X'00000000') to 65,535 (X'0000FFFF').
0008 0009 ESIN value is nonzero and not in the range 4352 (X'00001100') to 65,534 (X'0000FFFE').


Usage Notes

  1. Often it is required to find the CCSID when the ES, CS, and CP values are known. CS and CP (also known as CGCSGID or GCID) is used in many existing IBM(TM) architectures and data streams and supporting products. Together with the CDRSCSP API, this function aids in coexistence and migration for products that have to deal with the short form (CCSID) of identification on one side and the intermediate form (CPGID) on the other. Because the intermediate forms are, by themselves, incomplete when used in some encoding schemes, the function can return only a default value as defined in the installation's resources, when the ESIN information is unknown.

  2. Some code page identifiers in use in the Far East refer to "pseudo" or "combined" code pages with the PC mixed and host mixed encoding schemes. These identifiers are to be used as CCSIDs rather than CPGIDs. The CDRSMXC function does not return the corresponding CCSIDs for these combined code page identifier values. Please refer to the documentation for the QTQSMXC2 API for support of some of these code page identifiers.

  3. When an ESIN value of zero is specified, the feedback code is never returned as zero. Absence of an error results in a 0001 0003 feedback code.

API introduced: V3R6
top | National Language Support APIs | APIs by category