ibm-information-center/dist/eclipse/plugins/i5OS.ic.rbam6_5.4.0.1/rbam6opsinexp.htm

192 lines
10 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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="Operators in expressions" />
<meta name="abstract" content="Operators are used in expressions to indicate an action to be performed on the operands in the expression or the relationship between the operands." />
<meta name="description" content="Operators are used in expressions to indicate an action to be performed on the operands in the expression or the relationship between the operands." />
<meta name="DC.Relation" scheme="URI" content="rbam6xpressincom.htm" />
<meta name="DC.Relation" scheme="URI" content="rbam6relatexp.htm" />
<meta name="DC.Relation" scheme="URI" content="rbam6charuse.htm" />
<meta name="DC.Relation" scheme="URI" content="rbam6symops.htm" />
<meta name="DC.Relation" scheme="URI" content="addcbrkpt.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="rbam6opsinexp" />
<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>Operators in expressions</title>
</head>
<body id="rbam6opsinexp"><a name="rbam6opsinexp"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Operators in expressions</h1>
<div><p>Operators are used in expressions to indicate an action to be performed
on the operands in the expression or the relationship between the operands. </p>
<div class="section"><p>There are four kinds of operators, one for each of the four types
of expressions:</p>
<ul><li>Arithmetic operators <samp class="codeph">(+, -, *, /)</samp></li>
<li>Character operator <samp class="codeph">(||, |&gt;, |&lt;)</samp></li>
<li>Logical operators <samp class="codeph">(&amp;, |, ¬)</samp></li>
<li>Relational operators <samp class="codeph">(=, &gt;, &lt;, &gt;=, &lt;=, ¬=, ¬&gt;, ¬&lt;)</samp> </li>
</ul>
<p>Each operator must be between the operands of the expression in which
it is used; for example, <samp class="codeph">(&amp;A + 4)</samp>. Operators can be
specified as a predefined value (for example, *EQ) or as a symbol (for example,
=).</p>
<ul><li>All predefined value operators must have a blank on each side of the operator: <pre>(&amp;VAR *EQ 7)</pre>
</li>
<li>Except for the division operator (/), symbolic operators need no blanks
on either side. For example, either <samp class="codeph">(&amp;VAR=7)</samp> or <samp class="codeph">(&amp;VAR =
7)</samp> is valid. <p>Where the division operator <em>follows</em> a variable
name, the division operator must be preceded by a blank. For example, <samp class="codeph">(&amp;VAR
/ 5)</samp> or <samp class="codeph">(&amp;VAR /5)</samp> is valid; <samp class="codeph"> (&amp;VAR/5)</samp> is
not valid.</p>
</li>
</ul>
<p>The following character combinations are the predefined values and
symbols that represent the four kinds of operators; they should not be used
in unquoted strings for any other purpose.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="border" border="1" rules="all"><caption>Table 1. Predefined values
and symbols representing the four kinds of operators</caption><thead align="left"><tr><th valign="top" id="d0e89">Predefined Value</th>
<th valign="top" id="d0e91">Predefined Symbol</th>
<th valign="top" id="d0e93">Meaning</th>
<th valign="top" id="d0e95">Type</th>
</tr>
</thead>
<tbody><tr><td valign="top" headers="d0e89 "> </td>
<td valign="top" headers="d0e91 ">+</td>
<td valign="top" headers="d0e93 ">Addition</td>
<td valign="top" headers="d0e95 ">Arithmetic operator</td>
</tr>
<tr><td valign="top" headers="d0e89 "> </td>
<td valign="top" headers="d0e91 ">-</td>
<td valign="top" headers="d0e93 ">Subtraction</td>
<td valign="top" headers="d0e95 ">Arithmetic operator</td>
</tr>
<tr><td valign="top" headers="d0e89 "> </td>
<td valign="top" headers="d0e91 ">*</td>
<td valign="top" headers="d0e93 ">Multiplication</td>
<td valign="top" headers="d0e95 ">Arithmetic operator</td>
</tr>
<tr><td valign="top" headers="d0e89 "> </td>
<td valign="top" headers="d0e91 ">/</td>
<td valign="top" headers="d0e93 ">Division</td>
<td valign="top" headers="d0e95 ">Arithmetic operator</td>
</tr>
<tr><td valign="top" headers="d0e89 ">*CAT</td>
<td valign="top" headers="d0e91 ">|| <sup>1</sup></td>
<td valign="top" headers="d0e93 ">Concatenation</td>
<td valign="top" headers="d0e95 ">Character string operator</td>
</tr>
<tr><td valign="top" headers="d0e89 ">*BCAT</td>
<td valign="top" headers="d0e91 ">|&gt; <sup>1</sup></td>
<td valign="top" headers="d0e93 ">Blank insertion with concatenation</td>
<td valign="top" headers="d0e95 ">Character string operator</td>
</tr>
<tr><td valign="top" headers="d0e89 ">*TCAT</td>
<td valign="top" headers="d0e91 ">|&lt; <sup>1</sup></td>
<td valign="top" headers="d0e93 ">Blank truncation with concatenation</td>
<td valign="top" headers="d0e95 ">Character string operator</td>
</tr>
<tr><td valign="top" headers="d0e89 ">*AND</td>
<td valign="top" headers="d0e91 ">&amp;</td>
<td valign="top" headers="d0e93 ">AND</td>
<td valign="top" headers="d0e95 ">Logical operator</td>
</tr>
<tr><td valign="top" headers="d0e89 ">*OR</td>
<td valign="top" headers="d0e91 ">| <sup>1</sup></td>
<td valign="top" headers="d0e93 ">OR</td>
<td valign="top" headers="d0e95 ">Logical operator</td>
</tr>
<tr><td valign="top" headers="d0e89 ">*NOT</td>
<td valign="top" headers="d0e91 "> ¬ <sup>2</sup> </td>
<td valign="top" headers="d0e93 ">NOT</td>
<td valign="top" headers="d0e95 ">Logical operator</td>
</tr>
<tr><td valign="top" headers="d0e89 ">*EQ</td>
<td valign="top" headers="d0e91 ">=</td>
<td valign="top" headers="d0e93 ">Equal</td>
<td valign="top" headers="d0e95 ">Relational operator</td>
</tr>
<tr><td valign="top" headers="d0e89 ">*GT</td>
<td valign="top" headers="d0e91 ">&gt;</td>
<td valign="top" headers="d0e93 ">Greater than</td>
<td valign="top" headers="d0e95 ">Relational operator</td>
</tr>
<tr><td valign="top" headers="d0e89 ">*LT</td>
<td valign="top" headers="d0e91 ">&lt;</td>
<td valign="top" headers="d0e93 ">Less than</td>
<td valign="top" headers="d0e95 ">Relational operator</td>
</tr>
<tr><td valign="top" headers="d0e89 ">*GE</td>
<td valign="top" headers="d0e91 ">&gt;=</td>
<td valign="top" headers="d0e93 ">Greater than or equal</td>
<td valign="top" headers="d0e95 ">Relational operator</td>
</tr>
<tr><td valign="top" headers="d0e89 ">*LE</td>
<td valign="top" headers="d0e91 ">&lt;=</td>
<td valign="top" headers="d0e93 ">Less than or equal</td>
<td valign="top" headers="d0e95 ">Relational operator</td>
</tr>
<tr><td valign="top" headers="d0e89 ">*NE</td>
<td valign="top" headers="d0e91 "> ¬= <sub>2</sub></td>
<td valign="top" headers="d0e93 ">Not equal</td>
<td valign="top" headers="d0e95 ">Relational operator</td>
</tr>
<tr><td valign="top" headers="d0e89 ">*NG</td>
<td valign="top" headers="d0e91 "> ¬&gt; <sub>2</sub></td>
<td valign="top" headers="d0e93 ">Not greater than</td>
<td valign="top" headers="d0e95 ">Relational operator</td>
</tr>
<tr><td valign="top" headers="d0e89 ">*NL</td>
<td valign="top" headers="d0e91 "> ¬&lt; <sub>2</sub></td>
<td valign="top" headers="d0e93 ">Not less than</td>
<td valign="top" headers="d0e95 ">Relational operator</td>
</tr>
<tr><td colspan="4" valign="top" headers="d0e89 d0e91 d0e93 d0e95 "><div class="note"><span class="notetitle">Note:</span> <ol><li>In some national character sets and in the multinational character set,
the character | (hexadecimal 4F) is replaced by the character ! (exclamation
point). Either ! or *OR can be used as the OR operator and either || or *CAT,
!&gt; or *BCAT, and !&lt; or *TCAT can be used for concatenation in those
character sets. </li>
<li>In some national character sets and in the multinational character set,
the character ¬ (hexadecimal 5F) is replaced by the character
*. Either * or *NOT can be used as the NOT operator in those character sets.</li>
</ol>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</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 class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="rbam6charuse.htm" title="Special characters can be used only in these special ways or inside quoted character strings or comments.">Special character use</a></div>
<div><a href="rbam6symops.htm" title="A variety of characters can be used as symbolic operators in CL commands.">Symbolic operators</a></div>
</div>
<div class="reltasks"><strong>Related tasks</strong><br />
<div><a href="addcbrkpt.htm" title="You can add a conditional breakpoint to a program that is being debugged using the Add Breakpoint (ADDBKP) command to specify the statement and condition.">Add conditional breakpoints</a></div>
</div>
<div class="relref"><strong>Related reference</strong><br />
<div><a href="rbam6relatexp.htm" title="The operands in a relational expression can be arithmetic or character string expressions; they can also be logical constants and logical variables.">Relational expressions</a></div>
</div>
</div>
</body>
</html>