Configuring the _CODESET Program [ COBOL/HP-UX Operating Guide for the Series 700 and 800 ] MPE/iX 5.0 Documentation
COBOL/HP-UX Operating Guide for the Series 700 and 800
Configuring the _CODESET Program
The _CODESET module supplied with the system software is used at run time
to convert ASCII to EBCDIC and EBCDIC to ASCII
when certain COBOL syntax is used. You can reconfigure the _CODESET.cbl
file by amending the 256-byte conversion tables within the _CODESET
program. When amending these conversion tables, you must use the binary
value of the source character+1 to index into the table. The character
at this index point is the target character.
The _CODESET program accepts three parameters which the Compiler uses to
convert text strings into either EBCDIC or ASCII text depending on the
type of statement being executed at the time.
char-buff a PIC 9(2) COMP-X field which contains a value
indicating the function required:
0 the buffer is to contain EBCDIC data, so the
data of a specified length will be converted
to ASCII
1 the buffer is to contain ASCII data, so the
data of the specified length will be
converted to EBCDIC
2 the 256-byte EBCDIC to ASCII conversion type
used for char-buff=0 is moved to the data
area. If char-buff=2, then buff-len is
ignored, and a full 256-byte move takes place
3 the 256-byte ASCII to EBCDIC conversion table
used for char-buff=1 is moved into the data
area. If the char-buff=3, then buff-len is
ignored, and a full 256-byte move takes
place.
buff-len a PIC 9(9) COMP-X field specifying the length of
char-buff
buff-name a PIC X(256) field containing the name of the
buffer.
When you have changed the _CODESET.cbl file, you must then recompile it
so that the Compiler can make CALLs to the new version of _CODESET.cbl
(see Chapter 3 , Compiling).
Statically Linking _CODESET
To statically link the new version of _CODESET.cbl, you should create an
object file by entering the command:
cob -xC _CODESET.cbl
which creates the file _CODESET.o. You can then use the ar UNIX system
command to put this object file into the files $COBDIR/coblib/cobolobjs.a
and $COBDIR/coblib/libcobol.a (see Chapter 6 , Linking).
MPE/iX 5.0 Documentation