GET BIT n OF f INTO g.
The
nth bit (from the left, beginning at 1) of field f
is placed in the field
g.
n must
be positive and be convertible into type I. The value
of
n must not be longer than the length in bits of f.
f must have type X,
and can be of any length up to the maximum permitted for type X.
You can use a XSTRING-type variable instead of a field.
Note that n does not overwrite the current length of f; the system does not adjust the length in any way.
,,The Return Code is set as follows:
DATA: F(2) TYPE X VALUE '8000',
G TYPE I.
GET BIT 1 OF F INTO G.
WRITE G.
Output: 1
Non-Catchable Exceptions
In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs. See Changes Relating to Unicode
Setting and Reading Bits