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

IP.com Disclosure Number: IPCOM000013401D
Original Publication Date: 2000-May-01
Included in the Prior Art Database: 2003-Jun-18
Document File: 1 page(s) / 42K

Publishing Venue

IBM

Abstract

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

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 100% of the total text.

Page 1 of 1

  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

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