Browse Prior Art Database

HEX2CHAR: Convert DB2 VARCHAR For Bit Data Text from Hexidecimal to Readable Text Whether or not First Two Bytes of Text Contain the Length Indicator Disclosure Number: IPCOM000013401D
Original Publication Date: 2000-May-01
Included in the Prior Art Database: 2003-Jun-18

Publishing Venue



Disclosed here is a function, referred to as hex2char, that translates binary data into readable character data according to a well defined encoding scheme. Without such a function, the data is displayed to the user in a binary encoding, for example hexadecimal, which is not as useful as displaying readable character data. In particular, the hex2char function is applicable to SAP* data that is imported into a DataBase Management System (DBMS), such as DB2**. The SAP character data is imported into the DBMS as a binary data type, such as DB2's VARCHAR FOR BIT DATA. The SAP character data is encoded according to the following scheme: given binary data of a particular length, J. If the first two bytes are interpreted as an unsigned integer, K, and K is equal to J minus two, then the remaining K bytes are character data. Otherwise all J bytes are character data. Without the hex2char function, the data can only be displayed as binary encoded data; where as, with the hex2char function, implemented as a User Defined Function (UDF) in the DBMS, the data can be displayed as readable character data. Trademark of SAP AG. Trademark of IBM corp. 1