The Calculate Boolean Value command provides input of two 4 byte
argument values and returns the result in either or both a 4 byte
character value or an 8 byte hexadecimal value. The operation
performed can be *OR, *AND, XOR, *NOR, *NAND, or *NOT. The arguments
can contain 1-4 byte *CHAR type values. They can be variables,
literals, or hex values.
A typical command would be:
DCL &ARG1 *CHAR LEN(4)
DCL &ARG2 *CHAR LEN(4)
DCL &RESULT1 *CHAR LEN(4)
.
CLCBOOLVAL OP(*OR) ARG1(&ARG1) ARG2(&ARG2)
RESULT1(&RESULT1)
If both arguments contained 'Abbb' (where 'b' is a blank), the
&RESULT1 value would be 'Abbb' since both values have the same bits.
If RESULT2 had been specified, the value 'C1404040' would be
returned.
An 'Abbb' would also be returned if ARG2 was X'00404040' since *OR
was requested.
See the OP parameter details for a chart describing various
combinations and results.
CLCBOOLVAL escape messages you can monitor for
----------------------------------------------
None. Escape messages from based on functions will be re-sent.
CLCBOOLVAL Command parameters *CMD
-----------------------------
OP The operation to be performed.
*OR Logical OR
*AND Logical AND
*XOR Exclusive OR
*NOR Logical NOT OR
*NAND NOT AND
*NOT Logical not on ARG1
The following chart describes conditions and the
results for the supported boolean operations on all
combinations of pairs of bits.
Bit 1 Bit 2 Bit 3 Bit 4
----- ----- ----- -----
Argument 1 0 0 1 1
Argument 2 0 1 0 1
Results
-------
*OR 0 1 1 1
*AND 0 0 0 1
*XOR 0 1 1 0
*NOT 1 1 0 0
*NAND 1 1 1 0
*NOR 1 0 0 0
If only hexadecimal values are used for the
arguments, the results are CCSID independent. If
variables are used, the results may differ depending
on the CCSID used.
ARG1 The first argument. Up to 4 bytes may be entered.
Either a variable, a character literal, or a hex
value may be entered. To enter a literal hex value
larger than one byte, use the prompter & function to
expand the size of the input area.
ARG2 The second argument. Up to 4 bytes may be entered.
Either a variable, a character literal, or a hex
value may be entered. To enter a literal hex value
larger than one byte, use the prompter & function to
expand the size of the input area.
The value is ignored if the OP value is *NOT.
RESULT1 The result in a character value. The variable must
be declared as *CHAR LEN(4).
RESULT2 The result in hexadecimal. The variable must be
declared as *CHAR LEN(8).
Restrictions
------------
Because the command returns variables, CLCBOOLVAL may only be used in
a CL program.
Prerequisites
-------------
The following TAA Tools must be on your system:
SNDESCMSG Send escape message
Implementation
--------------
None, the tool is ready to use.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
CLCBOOLVAL *CMD TAACLTS QATTCMD
TAACLTSR *PGM RPGLE TAACLTSR QATTCL
|