SET BIT n OF f.
The
nth bit (from the left, starting at 1) of field f
is set to 1.
n must be positive, and either have type
I or be convertible into this type. The value of n
must not exceed the length (in bits) of
f.
f must
have type X. It can be of any length up to the maximum
permitted for data type X.
You can also use a variable
of the type XSTRING instead of a field. Make sure that
n does not exceed the current length of f; the length is not adjusted.
The Return Code is set as follows:
... TO g
You can use the ... TO g addition to determine the value
to which the bit should be set. g must have the value 1 or 0.
DATA F(2) TYPE X.
SET BIT 1 OF F.
WRITE F.
Output: 8000
Non-Catchable Exceptions
In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs.
See Unicode Changes
Set and Read Bits