As mentioned earlier, REXX considers a numeric string to be in base 10. You cannot express a number in some other base, and use it directly in a mathematical expression, or anywhere that you would use a numeric string. Instead, you must use one of the conversion built-in functions to convert the string into a base 10 numeric string.

Let's take an example of a base 10 numeric string. Here is how we express the value 74 in base 10:

'74'
Of course, for a numeric string in base 10, we can omit the quotes around it.

To express this as a hexadecimal number (ie, base 16), we could express it as so:

'4A'
But we can't use this in a mathematical expression, because it has a non-numeric (base 10) character (ie, 'A') in it. Besides, REXX always assumes that numbers are in base 10, which our above hexadecimal value is not. For example, the following would raise a SYNTAX condition:
value = '4A' + '1'
So, we must use the X2D() built-in function to first convert the hexadecimal value to a decimal (base 10) value, as so:
value = X2D('4A') + '1'
This correctly sets the value of the variable value to 75 decimal. Now, if we want to convert value back to a string expressed in hexadecimal, we can use the D2X() built-in function as so:
value = D2X(value)
You may be wondering what is the difference between the following 2 lines:
value = X2D('4A')
value = '4A'X
The first line takes a string with the hexadecimal value '4A', converts it to a decimal numeric string 74, and assigns it to value. The second line assigns the special (ie, non-numeric) character with a hexadecimal value '4A' (ie, an ASCII 'J') to value. So, the second line is equivalent to:
value = X2C('4A')
...or...
value = 'J'

REXX has conversion functions to go between hexadecimal, binary (base 2), and decimal. These are the only 3 bases supported in REXX itself.

There are also functions to convert any hex, binary, or decimal number to its equivalent ASCII (special) character (or sequence of characters if the number is too large to translate to only one special character).