TAA Tools
OR      OR TWO VARIABLES TOGETHER           TAACLPE

The OR command  allows you to take  two variables and OR  them together
in an 'exclusive OR' and returns a variable with the ORed bits.

This  command is  of  value when  attempting  to mask  certain  data or
other general use functions for an exclusive OR.

An exclusive OR is defined as:

   - If both bits are on, the resulting bit is off
   - If both bits are off, the resulting bit is off
   - If one bit is on and the other off, the resulting bit is on

An  exclusive OR  function has the  interesting property  of allowing a
field to  be masked  and then  unmasked by  ORing back  the same  value
that  was  used  to mask  the  field.    Multiple  fields can  be  ORed
together  and the original  result retrieved by repeating  the same set
of OR functions.   This is essentially the  same technique used by  the
system for the checksum function of DASD recovery.

Command parameters                                    *CMD
------------------

   INPUT1        The  first  variable  to  be  ORed.    It  must  be  a
                 character variable  of length 256.   The value must be
                 left justified.

   INPUT2        The second  variable  to  be  ORed.    It  must  be  a
                 character variable of  length 256.  The value  must be
                 left justified.

   OUTPUT        The output  variable which contains the  result of the
                 OR  command.    It  must be  a  character  variable of
                 length 256.

   LEN           The length of the fields  to be ORed.  This must  be a
                 decimal   variable  of   LEN(3   0).     There  is   a
                 performance  advantage   to  only  OR  the  number  of
                 characters required.

The processing  program can  be called  directly instead  of using  the
command.  The parameter list is the same as that on the command.

The command is written  so the processing program is  not ended when it
is invoked  (i.e.  LR is not set on  when the command completes).  This
allows faster performance when  the command is  used multiple times  in
succession.   When  you  are  finished  with the  command,  you  should
either use  the FREE operation within RPG or  the RCLRSC command to get
rid of the program's storage.

Restrictions
------------

None.

Prerequisites
-------------

None.

Implementation
--------------

None, the tool is ready to use.

Objects used by the tool
------------------------

   Object        Type       Attribute      Src member     Src file
   ------        -----      ---------      ----------     -----------

   OR            *CMD                      TAACLPE        QATTCMD
   TAACLPER      *PGM          RPG         TAACLPER       QATTRPG

Note that no CL program exists.  The RPG program is the CPP.
					

Added to TAA Productivity tools April 1, 1995


Home Page Up to Top