92 lines
6.4 KiB
HTML
92 lines
6.4 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="Expressions in CL commands" />
|
||
|
<meta name="abstract" content="A character string expression can be used for any parameter, element, or qualifier defined with EXPR(*YES) in the command definition object." />
|
||
|
<meta name="description" content="A character string expression can be used for any parameter, element, or qualifier defined with EXPR(*YES) in the command definition object." />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbam6clprograms.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbam6arithexp.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbam6charstrngexp.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbam6relatexp.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbam6logicexp.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbam6opsinexp.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbam6operpriority.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbam6express.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="rbam6xpressincom" />
|
||
|
<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>Expressions in CL commands</title>
|
||
|
</head>
|
||
|
<body id="rbam6xpressincom"><a name="rbam6xpressincom"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Expressions in CL commands</h1>
|
||
|
<div><p>A character string expression can be used for any parameter, element,
|
||
|
or qualifier defined with EXPR(*YES) in the command definition object.</p>
|
||
|
<div class="section"><p>Any expression can be used as a single parameter in the <span class="cmdname">Change
|
||
|
Variable (CHGVAR)</span> and <span class="cmdname">If (IF)</span> commands.
|
||
|
An expression in its simple form is a single constant, a variable, or a built-in
|
||
|
function. An expression usually contains two operands and an operator that
|
||
|
indicates how the expression is to be evaluated. Two or more expressions can
|
||
|
be combined to make a complex expression.</p>
|
||
|
<p>The following types of expressions
|
||
|
are supported in CL programs:</p>
|
||
|
<ul><li> Arithmetic <samp class="codeph">(&VAR + 15)</samp> </li>
|
||
|
<li> Character string <samp class="codeph">(SIX || TEEN)</samp> </li>
|
||
|
<li> Relational <samp class="codeph">(&VAR > 15)</samp></li>
|
||
|
<li> Logical <samp class="codeph">(&VAR & &TEST)</samp></li>
|
||
|
</ul>
|
||
|
<p>A <em>complex</em> expression contains multiple operands, operators
|
||
|
that indicate what operation is performed on the operands, and parentheses
|
||
|
to group them. Only one operator is allowed between operands, except for the
|
||
|
+ and - signs when they immediately precede a decimal value (as a signed value),
|
||
|
and the *NOT operator when it is used in a logical expression.No complex expression
|
||
|
can have more than five nested levels of parentheses, including the outermost
|
||
|
(required) level.</p>
|
||
|
<p>Arithmetic and character string expressions can be
|
||
|
used together in a complex expression if they are used with relational and
|
||
|
logical operators; for example: <samp class="codeph">(A=B&(1+2)=3)</samp>. A pair
|
||
|
of arithmetic expressions or a pair of character string expressions can be
|
||
|
compared within a relational expression. Also, relational expressions can
|
||
|
be used within a logical expression</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<ul class="ullinks">
|
||
|
<li class="ulchildlink"><strong><a href="rbam6arithexp.htm">Arithmetic expressions</a></strong><br />
|
||
|
The operands in an arithmetic expression must be decimal constants or decimal or integer CL variables.</li>
|
||
|
<li class="ulchildlink"><strong><a href="rbam6charstrngexp.htm">Character string expressions</a></strong><br />
|
||
|
The operands in a character string expression must be quoted or unquoted character strings, character variables, or the substring (%SUBSTRING or %SST) built-in function.</li>
|
||
|
<li class="ulchildlink"><strong><a href="rbam6relatexp.htm">Relational expressions</a></strong><br />
|
||
|
The operands in a relational expression can be arithmetic or character string expressions; they can also be logical constants and logical variables.</li>
|
||
|
<li class="ulchildlink"><strong><a href="rbam6logicexp.htm">Logical expressions</a></strong><br />
|
||
|
The operands in a logical expression consist of relational expressions, logical variables, or constants, separated by logical operators.</li>
|
||
|
<li class="ulchildlink"><strong><a href="rbam6opsinexp.htm">Operators in expressions</a></strong><br />
|
||
|
Operators are used in expressions to indicate an action to be performed on the operands in the expression or the relationship between the operands.</li>
|
||
|
<li class="ulchildlink"><strong><a href="rbam6operpriority.htm">Priority of operators when evaluating expressions</a></strong><br />
|
||
|
When multiple operators occur in an expression, the expression is evaluated in a specific order depending upon the operators in the expression.</li>
|
||
|
</ul>
|
||
|
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbam6clprograms.htm" title="This covers elements of CL such as character sets and values, expressions, built-in functions, and naming within commands.">Control language elements</a></div>
|
||
|
</div>
|
||
|
<div class="relref"><strong>Related reference</strong><br />
|
||
|
<div><a href="rbam6express.htm" title="An expression is the value used as the result of evaluating an expression.">Expressions</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|