BITSON: Determining If a Bit Is On or Off

How to:

The BITSON function evaluates an individual bit within a character string to determine whether it is on or off. If the bit is on, BITSON returns a value of 1. If the bit is off, it returns a value of 0. This function is useful in interpreting multi-punch data, where each punch conveys an item of information.

Syntax: How to Determine If a Bit Is On or Off

where:

bitnumber

Integer

Is the number of the bit to be evaluated, counted from the left-most bit in the character string.

Alphanumeric

Is the character string to be evaluated. The character string is in multiple eight-bit blocks.

Integer

Example: Evaluating a Bit in a Field

BITSON evaluates the 24th bit of LAST_NAME:

WebFOCUS

Feedback