BXOR Function

Returns the bitwise logical EXCLUSIVE OR of two 32-bit integer values.

Category:Bitwise Logical Operations

Syntax

Required Arguments

argument-1

specifies a numeric constant, variable, or expression.

RangeAn integer value between 0 and (232)–1 inclusive

argument-2

specifies a numeric constant, variable, or expression.

RangeAn integer value between 0 and (232)–1 inclusive

Details

A bitwise XOR is a binary operation that takes two bit patterns of equal length and performs the logical exclusive OR operation on each pair of corresponding bits. The result in each position is 1 if only one of the bits is 1, but will be 0 if both are 0 or both are 1.

If either argument contains a missing value, the function returns a missing value and sets _ERROR_ equal to 1. Otherwise, each argument is internally converted to a 32-bit integer. BXOR computes the bitwise logical exclusive OR of these two integers and converts the result back to a returned-double-floating-point value.

Example

data one;
   x = 12;
   y = 10;
   z = BXOR(x,y);
   put x=binary4.;
   put y=binary4.;
   put z=binary4. Z=;
run;

The preceding statements produce this result:

x=1100
y=1010
z=0110 z=6
Last updated: April 14, 2026