IBM SC34-5764-01 Server User Manual


 
 X2D(hexstring
,n
) 
returns the decimal representation of hexstring. The hexstring is a string of hexadecimal characters. If the
result cannot be expressed as a whole number, an error results. That is, the result must not have more
digits than the current setting of NUMERIC DIGITS.
You can optionally include blanks in hexstring (at byte boundaries only, not leading or trailing) to aid
readability; they are ignored.
If hexstring is null, the function returns 0.
If you do not specify n, hexstring is processed as an unsigned binary number.
Here are some examples:
X2D('0E') -> 14
X2D('81') -> 129
X2D('F81') -> 3969
X2D('FF81') -> 65409
X2D('c6 f0'X) -> 240 /* EBCDIC */
If you specify n, the string is taken as a signed number expressed in n hexadecimal digits. If the leftmost
bit is off, then the number is positive; otherwise, it is a negative number in two's complement notation. In
both cases it is converted to a whole number, which may, therefore, be negative. If n is 0, the function
returns 0.
If necessary, hexstring is padded on the left with 0 characters (note, not “sign-extended”), or truncated on
the left to n characters.
Here are some examples:
X2D('81',2) -> -127
X2D('81',4) -> 129
X2D('F081',4) -> -3967
X2D('F081',3) -> 129
X2D('F081',2) -> -127
X2D('F081',1) -> 1
X2D('0031',0) -> 0
Implementation maximum: The input string may not have more than 500 hexadecimal characters that
will be significant in forming the final result. Leading sign characters (0 and F) do not count towards this
total.
External Functions Provided in REXX/CICS
Additional external functions provided in the REXX/CICS environment are discussed in this section.
STORAGE
Note: This is an authorized function.
 STORAGE(address
,
length ,data
) 
returns length bytes from the user's memory starting at address. The length is in decimal; the default is 1
byte. The address is a hexadecimal number. The high-order bit of address is ignored.
Functions
200
CICS TS for VSE/ESA: REXX Guide