69 lines
4.0 KiB
HTML
69 lines
4.0 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html
|
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html lang="en-us" xml:lang="en-us">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta name="security" content="public" />
|
|
<meta name="Robots" content="index,follow" />
|
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
|
<meta name="DC.Type" content="reference" />
|
|
<meta name="DC.Title" content="Logical expressions" />
|
|
<meta name="abstract" content="The operands in a logical expression consist of relational expressions, logical variables, or constants, separated by logical operators." />
|
|
<meta name="description" content="The operands in a logical expression consist of relational expressions, logical variables, or constants, separated by logical operators." />
|
|
<meta name="DC.Relation" scheme="URI" content="rbam6xpressincom.htm" />
|
|
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
|
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
|
|
<meta name="DC.Format" content="XHTML" />
|
|
<meta name="DC.Identifier" content="rbam6logicexp" />
|
|
<meta name="DC.Language" content="en-us" />
|
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
|
<!-- US Government Users Restricted Rights -->
|
|
<!-- Use, duplication or disclosure restricted by -->
|
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
|
<title>Logical expressions</title>
|
|
</head>
|
|
<body id="rbam6logicexp"><a name="rbam6logicexp"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Logical expressions</h1>
|
|
<div><p>The operands in a logical expression consist of relational expressions,
|
|
logical variables, or constants, separated by logical operators.</p>
|
|
<div class="section"><p> Two or more of these types of operands can be used in combinations,
|
|
making up two or more expressions within expressions, up to the maximum of
|
|
five nested levels of parentheses. The result of a logical expression is a
|
|
'0' or '1' that can be used as part of another expression or saved in logical
|
|
variables.</p>
|
|
<p>The logical operators used to specify the relationship between
|
|
the operands are *AND and *OR (as reserved values), and & and | (as symbols).
|
|
The AND operator indicates that both operands (on either side of the operator)
|
|
have to be a certain value to produce a particular result. The OR operator
|
|
indicates that one or the other of its operands can determine the result.</p>
|
|
<p>The
|
|
logical operator *NOT (or <img src="notsym.gif" alt="not symbol" />)
|
|
is used to negate logical variables or logical constants. All *NOT operators
|
|
are evaluated before the *AND or *OR operators are evaluated. All operands
|
|
that follow *NOT operators are evaluated before the logical relationship between
|
|
the operands is evaluated.</p>
|
|
<p>The following are examples of logical expressions:</p>
|
|
<pre>((&C *LT 1) *AND (&TIME *GT 1430))
|
|
(&C *LT 1 *AND &TIME *GT 1430)
|
|
((&C < 1) & (&TIME *GT 1430))
|
|
((&C<1)&(&TIME>1430))
|
|
|
|
(&A *OR *NOT &B)
|
|
(&TOWN *EQ CHICAGO *AND &ZIP *EQ 60605)</pre>
|
|
<p>Two examples of logical expressions used in the IF command
|
|
are:</p>
|
|
<pre>IF &A CALL PROG1
|
|
IF (&A *OR &B) CALL PROG1</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbam6xpressincom.htm" title="A character string expression can be used for any parameter, element, or qualifier defined with EXPR(*YES) in the command definition object.">Expressions in CL commands</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |