X2B (Hexadecimal To Binary); X2C (Hexadecimal To Character); X2D (Hexadecimal To Decimal) - IBM SC34-5764-01 Manual

Cics transaction server for vse/esa
Table of Contents

Advertisement

and end. The default value for start is '00'x, and the default value for end is 'FF'x. If start is greater than
end, the values wrap from 'FF'x to '00'x. If specified, start and end must be single characters.
Here are some examples:
XRANGE('a','f')
->
XRANGE('03'x,'07'x) ->
XRANGE(,'04'x)
->
XRANGE('i','j')
->
XRANGE('FE'x,'02'x) ->

X2B (Hexadecimal to Binary)

X2B(hexstring)
returns a string, in character format, that represents hexstring converted to binary. The hexstring is a string
of hexadecimal characters. It can be of any length. Each hexadecimal character is converted to a string of
four binary digits. You can optionally include blanks in hexstring (at byte boundaries only, not leading or
trailing) to aid readability; they are ignored.
The returned string has a length that is a multiple of four, and does not include any blanks.
If hexstring is null, the function returns a null string.
Here are some examples:
X2B('C3')
-> '11000011'
X2B('7')
-> '0111'
X2B('1 C1')
-> '000111000001'
You can combine X2B with the functions D2X and C2X to convert numbers or character strings into binary
form.
Here are some examples:
X2B(C2X('C3'x)) -> '11000011'
X2B(D2X('129')) -> '10000001'
X2B(D2X('12'))
-> '1100'

X2C (Hexadecimal to Character)

X2C(hexstring)
returns a string, in character format, that represents hexstring converted to character. The returned string
is half as many bytes as the original hexstring. hexstring can be of any length. If necessary, it is padded
with a leading 0 to make an even number of hexadecimal 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 a null string.
Here are some examples:
X2C('F7F2 A2')
->
X2C('F7f2a2')
->
X2C('F')
->

X2D (Hexadecimal to Decimal)

'abcdef'
'0304050607'x
'0001020304'x
'898A8B8C8D8E8F9091'x /* EBCDIC */
'FEFF000102'x
'72s'
/* EBCDIC
'72s'
/* EBCDIC
' '
/* '0F' is unprintable EBCDIC */
*/
*/
Chapter 14. Functions
Functions
199

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Rexx

Table of Contents