Maybe, just running a simple test on various REXX conversion function would help a little with this mess?

Please note that any produced string which includes only characters '0'-'9' is considered as normal decimal value in any REXX arithmetic expression, even if it is the result of conversion "to binary", or "to hexadecimal".

Also, any decimal numeric value is considered as string in string-expected expressionConversion FunctionsB2X Returns a string, in character format, that represents the input binary

string converted to hexadecimal. (Binary to hexadecimal)

B2X( '0' ) = "0" = +0

B2X( '1' ) = "1" = +1

B2X( '10' ) = "2" = +2

B2X( '100' ) = "4" = +4

B2X( '1000' ) = "8" = +8

C2D Returns the decimal value of the binary representation of the input

string. (Character to Decimal)

C2D( '01'x ) = "01" = +1

C2D( '0A'x ) = "10" = +10

C2D( 'C1'x ) = "193" = +193

C2D( 'A' ) = "193" = +193

C2D( 'C' ) = "195" = +195

C2D( 'Z' ) = "233" = +233

C2D( '0' ) = "240" = +240

C2D( '5' ) = "245" = +245

C2D( '11' ) = "61937" = +61937

C2D( 'C1' ) = "50161" = +50161

C2D( 'F1' ) = "50929" = +50929

C2D( '128' ) = "15856376" = +15856376

C2D( '512' ) = "16118258" = +16118258

C2X Returns a string, in character format, that represents the input string

converted to hexadecimal. (Character to Hexadecimal)

C2X( ' ' ) = "40" = +40

C2X( 'A' ) = "C1" = 'C3F1'x

C2X( 'B' ) = "C2" = 'C3F2'x

C2X( 'C' ) = "C3" = 'C3F3'x

C2X( 'X' ) = "E7" = 'C5F7'x

C2X( 'Y' ) = "E8" = 'C5F8'x

C2X( 'Z' ) = "E9" = 'C5F9'x

C2X( '0' ) = "F0" = 'C6F0'x

C2X( 'C' ) = "C3" = 'C3F3'x

C2X( 'F' ) = "C6" = 'C3F6'x

C2X( 'C1' ) = "C3F1" = 'C3F3C6F1'x

C2X( 'F1' ) = "C6F1" = 'C3F6C6F1'x

C2X( '0' ) = "F0" = 'C6F0'x

C2X( '5' ) = "F5" = 'C6F5'x

C2X( '11' ) = "F1F1" = 'C6F1C6F1'x

C2X( '128' ) = "F1F2F8" = 'C6F1C6F2C6F8'x

C2X( '512' ) = "F5F1F2" = 'C6F5C6F1C6F2'x

D2C Returns a string, in character format, that represents the input decimal

number converted to binary. (Decimal to Character)

D2C( '0' ) = " " = '00'x

D2C( '5' ) = " " = '05'x

D2C( '11' ) = " " = '0B'x

D2C( '128' ) = " " = '80'x

D2C( 193 ) ==> "A" = ‘C1’x

D2C( '512' ) = " " = '0200'x

D2C( 1024 ) ==> '0400'x

D2X Returns a string, in character format, that represents the input decimal

number converted to hexadecimal. (Decimal to Hexadecimal)

D2X( '0' ) = "0" = +0

D2X( '5' ) = "5" = +5

D2X( 10 ) ==> "A" = ‘C1’x

D2X( '11' ) = "B" = 'C2'x

D2X( '128' ) = "80" = +80

D2X( '512' ) = "200" = +200

D2X( 1024 ) ==> "0400" = +400

X2B Returns a string, in character format, that represents the input

hexadecimal string converted to binary. (Hexadecimal to binary)

X2B( 12 ) ==> "00010010" = +10010

X2B( '0' ) = "0000" = +0

X2B( 'C' ) = "1100" = +1100

X2B( 'F' ) = "1111" = +1111

X2B( 'C1' ) = "11000001" = +11000001

X2B( 'F1' ) = "11110001" = +11110001

X2C Returns a string, in character format, that represents the input

hexadecimal string converted to character. (Hexadecimal to Character)

X2C( 1024 ) ==> '1024'x

X2C( "F1F2F3F4" ) ==> ‘F1F2F3F4’x = "1234" = +1234

X2C( '0' ) = " " = '00'x

X2C( 'C' ) = " " = '0C'x

X2C( 'F' ) = " " = '0F'x

X2C( 'C1' ) = "A" = 'C1'x

X2C( 'F1' ) = "1" = 'F1'x = +1

X2D Returns the decimal representation of the input hexadecimal string.

(Hexadecimal to Decimal)

X2D( 1000 ) ==> "4096" = +4096

X2D( 40 ) ==> "64" = +64

X2D( "FF" ) ==> "255" = +255

X2D( '0' ) = "0" = +0

X2D( 'C' ) = "12" = +12

X2D( 'F' ) = "15" = +15

X2D( 'C1' ) = "193" = +193

X2D( 'F1' ) = "241" = +241

Javas and Pythons come and go, but JCL and SORT stay forever.