Description:
Performs ASCII to EBCDIC conversion. The conversion is performed in place, meaning that the contents of the ASCII string variable will be replaced with the converted EBCDIC string.
Declaration:
subroutine APPCConvertA2E( integer:CONVERSATION_ID,
string: STRING,
integer:INDEX_START,
integer:INDEX_END,
integer:ASCII_TABLE,
integer:EBCDIC_TABLE )
library "eslappc"
Arguments:
•CONVERSATION_ID is an integer variable containing the conversation identifier (handle) for the APPC conversation returned by either APPCStart or APPCAcceptStart.
•STRING is a string variable containing the ASCII string to be converted to EBCDIC. When the conversion is complete, this string will contain EBCDIC characters.
•INDEX_START is an integer variable indicating the position of the first character in the string to be converted. The first character of a string is indexed by one. Zero can be used as a default value to mean start with the first character.
•INDEX_END is an integer variable indicating the position of the last character in the string to be converted. The number of characters in the string is equal to the index of the last character position. Zero can be used as a default value to indicate the last character.
•ASCII_TABLE is an integer variable representing the ASCII code page to use for conversion. If this value is zero, the ASCII code page specified in the ESL APPC profile is used.
•EBCDIC_TABLE is an integer variable representing the EBCDIC code page to use for conversion. If this value is zero, the EBCDIC code page specified in the ESL APPC profile is used.
Errors:
APPC_NORMAL_COMPLETION |
Normal completion. |
APPC_ERR_OUT_OF_MEMORY |
Out of memory. |
APPC_ERR_CONVERSION_ERROR |
Error on character conversion. |
APPC_ERR_INV_CONV_ID |
Invalid argument:CONVERSATION_ID |
APPC_ERR_INV_INDEX_START |
Invalid argument: INDEX_START |
APPC_ERR_INV_INDEX_END |
Invalid argument: INDEX_END |
APPC_ERR_INV_STRING_VAR |
Invalid string variable. |
APPC_ERR_INV_ASCII_TABLE |
Invalid argument: ASCII_TABLE |
APPC_ERR_INV_EBCDIC_TABLE |
Invalid argument: EBCDIC_TABLE |
APPC_ERR_UNEXPECTED_EASEL_ERROR |
Unexpected error on call to ESL routine. |
APPC_ERR_UNEXPECTED_ERROR |
Unexpected error encountered. |
Example:
copy 0 to Zero
call APPCConvertA2E (ConvID, # Handle from Start/AcceptStart
String, # Convert string to EBCDIC
Zero, Zero, # Convert the entire string
Zero, Zero ) # Use the default code pages