NET/MASTER Network Control Language (NCL) Reference Manual

C2B
Built-in Functions
4–26 106126 Tandem Computers Incorporated
C2B The C2B built-in function converts a string to its binary equivalent. It expands each
byte in the character string to eight 0s and/or 1s, giving an output bit string as the
returned value.
C2B(
string
)
string
specifies the source data to be converted.
Considerations
A null string returns a null string.
See also B2C, which converts a string of binary digits to characters.
Examples
The following example converts the string “AB” to the binary bit string
“0100000101000010”:
&A = AB
&RESULT = C2B(&A)
The following example converts the string '81'x to the binary bit string “10000001”.
The suffix “x” indicates that the supplied string is hexadecimal:
SAY C2B('81'x)