With a heterogeneous link to a UTM application, it may be the case that different codes (ASCII, EBCDIC) are used in the client and the server systems, because Unix, Linux and Windows systems use ASCII compatible codes, while BS2000 systems use EBCDIC code, for example:
a client application running on a Unix, Linux or a Windows system communicates with a UTM application on a BS2000 system.
a client application running on a BS2000 system communicates with a UTM application on a Unix, Linux or Windows system.
In the case of such a heterogeneous link, messages which contain printable characters can be converted, say for output. Pure binary data must not be converted. The conversion can take place either on the client side or on the server side. You must make sure that it only occurs once.
If the conversion is to take place in the client, two options are available with the UPIC carrier system:
The CPI-C calls Convert_Incoming and Convert_Outgoing
In this case, the data is converted by the program. With Convert_Incoming you can convert a received message into the code used locally (see section “Convert_Incoming - Converting data from code of sender to local code”). With Convert_Outgoing you can convert the data to be sent (before it is sent) from the local code into the code of the recipient (see section “Convert_Outgoing - Converting data from local code to code of receiver”).Automatic code conversion of the UPIC carrier system
You activate automatic code conversion for the connection to a specific server using the CHARACTER_CONVERTION conversation characteristic. You can activate CHARACTER_CONVERTION as follows:by entering a corresponding ID in the side information entry or the
upicfile
for this server (see section “Side information for standalone UTM applications”).or by means of the Set_Convertion() call.
When code conversion is activated, UPIC converts all data which arrives from this server into the locally used code before it is transferred to the client program, and all data sent from the client program to the server into the code of the server before it is sent. The client program no longer needs to deal with the conversion; Convert_Incoming and Convert_Outgoing must no longer be executed.
The automatic code conversion makes it possible with a single CPI-C program to communicate both with a UTM application on Unix, Linux or Windows systems based on the ASCII compatible code and with a UTM application on a BS2000 system based on an EBCDIC code (if the user data does not contain any binary information that was falsified during the code conversion).
CAUTION!
Keep in mind to convert the messages only once. Only messages containing printable characters may be safely converted. No conversion at all is allowed with a homogeneous link and with the link Windows system <-> Unix or Linux system.