POPCNT

POPCNT returns a FIXED BIN value holding in each byte the number of bits equal to 1 in the corresponding byte of x.
Read syntax diagramSkip visual syntax diagram
>>-POPCNT(x)---------------------------------------------------><

x
Expression.

x must have the attributes REAL FIXED BIN with a scale factor of zero.

The result has the same precision as x.

The result has the same (UN)SIGNED attribute as x.

See the following examples of using POPCNT:

On z/OS, the POPCNT(x) built-in function requires an ARCH level of 9 or higher.