In the OPEN, FETCH, CALL, and EXECUTE statements, the SQLNAME field of the SQLVAR element can be used to specify a CCSID for string host variables. If the SQLNAME field is used to specify a CCSID, the SQLNAME length must be set to 8. In addition, the first 4 bytes of SQLNAME must be set as described in the table below. If no CCSID is specified, the job CCSID is used.
In the DESCRIBE, DESCRIBE TABLE, and PREPARE statements, the SQLDATA field of the SQLVAR element contains the CCSID of the column of the result table if that column is a string column. The CCSID is located in bytes 3 and 4 as described in Table 99.
Data Type |
Encoding Scheme |
Bytes 1 & 2 | Bytes 3 & 4 |
---|---|---|---|
Character | SBCS data | X'0000' | ccsid |
Character | Mixed data | X'0000' | ccsid |
Character | Bit data | X'0000' | 65535 |
Graphic | Not Applicable | X'0000' | ccsid |
Any other data type | Not Applicable | Not Applicable | Not Applicable |