Converts a buffer of source characters from once CCSID into another CCSID.
Prerequisite: You must install the required CCSID conversion tables before you can convert from one CCSID to another; see
Installing CCSID translation tables.
Syntax:
call "CBL_CCSID_CONVERT" using by value flags
by reference src-buff
by value src-len
src-ccsid
by reference tgt-buff
by value tgt-len
tgt-ccsid
by reference tgt-actual-len
Parameters:
|
Using call prototype (see
Key)
|
Picture
|
flags
|
cblt-x4-comp5
|
pic x(4) comp-5
|
src-buff
|
pic x(n)
|
pic x(n)
|
src-len
|
cblt-x4-comp5
|
pic x(4) comp-5
|
src-ccsid
|
cblt-x4-comp5
|
pic x(4) comp-5
|
tgt-buff
|
pic x(n)
|
pic x(n)
|
tgt-len
|
cblt-x4-comp5
|
pic x(4) comp-5
|
tgt-ccsid
|
cblt-x4-comp5
|
pic x(4) comp-5
|
tgt-actual-len
|
cblt-x4-comp5
|
pic x(4) comp-5
|
On Entry:
- flags
-
Bits
|
Description
|
0-15
|
Internal use
|
16
|
User-specified flag - include custom tables (tables prefixed C0) when searching for a conversion table; for more information,
see
readme.txt within the
intro.zip file, available a part of
cdctables.zip.
|
17-31
|
User-specified flags - reserved for future use.
|
- src-buff
- Source characters to be converted.
- src-len
- Length of
src-buff (in bytes)
- src-ccsid
- CCSID of the source characters.
- tgt-buff
- Target buffer for converted characters.
- tgt-len
- Length of
tgt-buff (in bytes)
- tgt-ccsid
- CCSID of the target characters.
On Exit:
- tgt-actual-len
- The number of converted bytes in the output
- return-code
- Indicates whether the routine was successful:
0
|
Success
|
1
|
Conversion map files not installed
|
2
|
Target buffer is too small for conversion
|
3
|
Invalid maps files installed for conversion
|
4
|
Out of memory
|
5
|
Internal error
|
6
|
Unable to open map file
|
7
|
Unable to read map file
|
8
|
Invalid source data for conversion
|
9
|
Too many installed map files for conversion
|
10
|
IANA name not found
|
11
|
COBDIR is set to an invalid directory name
|
12
|
Flags invalid for conversion
|
Comments:
If the output buffer is empty (that is;
tgt-len= 0 or
tgt-buff is OMITTED),
tgt-actual-len returns the length of buffer required for the conversion to be successful.