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.
BITSON(bitnumber, source_string, output_format)
where:
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, in multiple 8-bit blocks.
Integer
BITSON evaluates the 24th bit of LAST_NAME:
BITSON(24, LAST_NAME, 'I1')
For SMITH, the result is 1.
For CROSS, the result is 9.
iWay Software |