Configuring the _CODESET Program [ Micro Focus COBOL for UNIX COBOL User Guide ] MPE/iX 5.0 Documentation
Micro Focus COBOL for UNIX COBOL User Guide
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
module by amending and recompiling the source file and building the new
module into the COBOL system. The source and copyfile are provided in
$COBDIR/src and you can reconfigure by changing the 256-byte conversion
tables in the _CODESET.cbl 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 is converted to ASCII
1=The buffer is to contain ASCII data, so the data
of the specified length is 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 the _CODESET
module. Make sure you also have the file codeset.cpy
present when you compile _CODESET.cbl.
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 UNIX system
command ar to put this object file into the COBOL system library
$COBDIR/coblib/libcobol.a. For example, ensure you are logged in as root
and enter the command:
ar rv $COBDIR/coblib/libcobol.a _CODESET.o
MPE/iX 5.0 Documentation