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

95 lines
5.4 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?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="task" />
<meta name="DC.Title" content="Change the value of variables" />
<meta name="abstract" content="You can change the value of variables by using the EVAL command with the assignment operator (=)." />
<meta name="description" content="You can change the value of variables by using the EVAL command with the assignment operator (=)." />
<meta name="DC.subject" content="variable, changing, value of" />
<meta name="keywords" content="variable, changing, value of" />
<meta name="DC.Relation" scheme="URI" content="dbgile.htm" />
<meta name="DC.Relation" scheme="URI" content="chglogvar.htm" />
<meta name="DC.Relation" scheme="URI" content="chgcharvar.htm" />
<meta name="DC.Relation" scheme="URI" content="chgdecvar.htm" />
<meta name="DC.Relation" scheme="URI" content="dbpgm.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="chgvarval" />
<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>Change the value of variables</title>
</head>
<body id="chgvarval"><a name="chgvarval"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Change the value of variables</h1>
<div><p>You can change the value of variables by using the EVAL command
with the assignment operator (=).</p>
<div class="section"> <p>The scope of the variables used in the EVAL command is defined
by using the QUAL command. However, you do not need to specifically define
the scope of the variables contained in a CL module because they are all of
global scope.</p>
<p>You can use the EVAL debug command to assign
numeric, character, and hexadecimal data to variables provided they match
the definition of the variable.</p>
<p>To change the value of the variable,
type the following on the debug command line: </p>
<pre>EVAL variable-name = value</pre>
<p><span class="synph"><span class="var">Variable-name</span></span> is the name of the
variable that you want to change and <span class="synph"><span class="var">value</span></span> is an
identifier or literal value that you want to assign to <span class="synph"><span class="var">variable-name</span></span>. </p>
<p>Look
at the next example:</p>
<pre>EVAL &amp;COUNTER = 3.0</pre>
<p>The above example changes the value of <span class="synph"><span class="var">&amp;COUNTER</span></span>;
to 3.0 and shows the following on the message line of the Display Module Source
display:</p>
<pre>&amp;COUNTER = 3.0 = 3.0</pre>
<p>The result is preceded by the variable-name and value you are
changing.</p>
<p>When you assign values to a character variable, the following
rules apply:</p>
<ul><li>If the length of the source expression is less than the length of the
target expression, the data is left justified in the target expression and
the remaining positions are filled with blanks.</li>
<li>If the length of the source expression is greater than the length of the
target expression, the data is left justified in the target expression and
truncated to the length of the target expression.</li>
</ul>
<div class="note"><span class="notetitle">Note:</span> DBCS variables can be assigned any of the following: <ul><li>Another DBCS variable</li>
<li>A graphic literal of the form G'&lt;so&gt;DBCS data&lt;si&gt;'</li>
<li>A hexadecimal literal of the form <span>X'hex digits'</span></li>
</ul>
</div>
</div>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="chglogvar.htm">Example: Change logical variable</a></strong><br />
You can change the value of a logical variable using the EVAL debug command.</li>
<li class="ulchildlink"><strong><a href="chgcharvar.htm">Examples: Change character variable</a></strong><br />
This example changes the value of a character variable using the EVAL debug command.</li>
<li class="ulchildlink"><strong><a href="chgdecvar.htm">Examples: Change decimal variable</a></strong><br />
You can change the value of a decimal variable using the EVAL debug command.</li>
</ul>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dbgile.htm" title="You can debug your ILE programs by using the ILE source debugger.">Debug ILE programs</a></div>
</div>
<div class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="dbpgm.htm" title="Many debug commands are available for use with the ILE source debugger.">Debug commands</a></div>
</div>
</div>
</body>
</html>