BINTOSTR( ) function

Returns Unicode character data converted from ZONED or EBCDIC character data. Abbreviation for “Binary to String”.


This function is specific to the Unicode edition of ACL. It is not a supported function in the non-Unicode edition.


BINTOSTR(string, string_type)



Character. The ZONED or EBCDIC value that you want to convert to Unicode character encoding.


Character constant. Specify A for ASCII if you are converting ZONED data, or E if you are converting EBCDIC data. The value specified must be enclosed in quotation marks.




You can use this function to convert return values from the ZONED( ) and EBCDIC( ) functions to a Unicode value. If this function is not applied to the return values of these functions they are displayed incorrectly because the encoding is not interpreted correctly.


Displaying a Unicode string correctly

The expression ZONED(-6448,4) should return the value “644Q”. However, ACL will not display “644Q” until you convert the characters to Unicode by using the BINTOSTR( ) function:

zonedData = ZONED(-6448,4)
unicodeData = BINTOSTR(zonedData, "A")

The unicodeData variable stores the return value of the function (“644Q”), which is formatted correctly with Unicode encoding.

(C) 2013 ACL Services Ltd. All Rights Reserved. | Send feedback