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

89 lines
5.8 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="Character string expressions" />
<meta name="abstract" content="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." />
<meta name="description" content="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." />
<meta name="DC.Relation" scheme="URI" content="rbam6xpressincom.htm" />
<meta name="DC.Relation" scheme="URI" content="rbam6charstrexpexmp.htm" />
<meta name="DC.Relation" scheme="URI" content="rbam6charstrexmp2.htm" />
<meta name="DC.Relation" scheme="URI" content="rbam6charstrings.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="rbam6charstrngexp" />
<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>Character string expressions</title>
</head>
<body id="rbam6charstrngexp"><a name="rbam6charstrngexp"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Character string expressions</h1>
<div><p>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. </p>
<div class="section"><p>The value associated with each variable or built-in function must
be a character string. The result of concatenation is a character string.</p>
<p>There
are three operators that can be used in character string expressions. These
operators concatenate (or join) two character strings, but each has a slightly
different function. They are:</p>
<dl><dt class="dlterm">*CAT (concatenation, symbol ||) operator</dt>
<dd><p>The *CAT operator concatenates two character strings. For example:
<samp class="codeph">ABC *CAT DEF</samp> becomes <samp class="codeph">ABCDEF</samp></p>
<p>Blanks
are included in the concatenation. For example: <samp class="codeph">'ABC ' *CAT 'DEF
'</samp> becomes <samp class="codeph">'ABC DEF '</samp></p>
</dd>
<dt class="dlterm">*BCAT (concatenation with blank insertion, symbol |&gt;) operator</dt>
<dd><p>The *BCAT operator truncates all trailing blanks in the first character
string; one blank is inserted, then the two character strings are concatenated.
Leading blanks on the second operand are not truncated. For example: <samp class="codeph">ABC
*BCAT DEF</samp> becomes <samp class="codeph">ABC DEF </samp> <samp class="codeph">'ABC ' *BCAT
DEF</samp> becomes <samp class="codeph">'ABC DEF'</samp></p>
</dd>
<dt class="dlterm">*TCAT (concatenation with trailing blank truncation, symbol |&lt;) operator</dt>
<dd><p>The *TCAT operator truncates all trailing blanks in the first character
string, then the two character strings are concatenated. All leading blanks
on the second operand are not truncated. For example: <samp class="codeph">ABC *TCAT DEF</samp> becomes
<samp class="codeph">ABCDEF</samp> <samp class="codeph">'ABC ' *TCAT DEF</samp> becomes <samp class="codeph">'ABCDEF'</samp> <samp class="codeph">ABC
*TCAT ' DEF'</samp> becomes <samp class="codeph">'ABC DEF'</samp> <samp class="codeph"> 'ABC '*TCAT
' DEF'</samp> becomes <samp class="codeph">'ABC DEF'</samp></p>
</dd>
</dl>
<p>All blanks that surround the concatenation
operator are ignored, but at least one blank must be on each side of the reserved
value operator (*CAT, *BCAT, or *TCAT). If multiple blanks are wanted in the
expression, a quoted character string (a character string enclosed within
apostrophes) must be used.</p>
</div>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="rbam6charstrexpexmp.htm">Example: Character string expressions</a></strong><br />
These are examples of string expressions.</li>
<li class="ulchildlink"><strong><a href="rbam6charstrexmp2.htm">Example: Use character strings and variables</a></strong><br />
This example shows how several character variables and character strings can be concatenated to produce a message for a work station operator.</li>
</ul>
<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="relref"><strong>Related reference</strong><br />
<div><a href="rbam6charstrings.htm" title="A character string is a string of any EBCDIC characters (alphanumeric and special) that are used as a value.">Character string</a></div>
</div>
</div>
</body>
</html>