z/OS TSO/E REXX Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


BITAND (Bit by Bit AND)

z/OS TSO/E REXX Reference
SA32-0972-00

Read syntax diagramSkip visual syntax diagram
>>-BITAND--(--string1--+------------------------+--)-----------><
                       '-,-+---------+-+------+-'      
                           '-string2-' '-,pad-'        

returns a string composed of the two input strings logically ANDed together, bit by bit. (The encoding of the strings are used in the logical operation.) The length of the result is the length of the longer of the two strings. If no pad character is provided, the AND operation stops when the shorter of the two strings is exhausted, and the unprocessed portion of the longer string is appended to the partial result. If pad is provided, it extends the shorter of the two strings on the right before carrying out the logical operation. The default for string2 is the zero length (null) string.

Here are some examples:
BITAND('12'x)                  ->    '12'x
BITAND('73'x,'27'x)            ->    '23'x
BITAND('13'x,'5555'x)          ->    '1155'x
BITAND('13'x,'5555'x,'74'x)    ->    '1154'x
BITAND('pQrS',,'BF'x)          ->    'pqrs'      /* EBCDIC  */

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014