The B2D function converts a character string value into its decimal equivalent. The number of bytes returned by this function is ten since it returns the integer value.
Category
String
Syntax
B2D(string_value, length)
Parameters and Descriptions
Parameter | Description |
---|---|
string_value | A source datastore field/column or the character string result of another Function. |
length | This parameter specifies a numeric value that specifies the number of characters (bytes) to be converted from the string_value. It can be a 4 or less byte string. |
Example
Translate a three (3) byte field, BINARY_FIELD, that contains the binary value F0B1CA into its hexadecimal character representation, the length field contains the value 6. It will map it to target field HEXCHAR.
HEXCHAR = B2D (BINARY_FIELD,4 )
Results in the source binary number being converted to a six (6) byte hex character equivalent of the number ('F0B1CA') being mapped to the six (6) byte field HEXCHAR.