84 lines
5.6 KiB
HTML
84 lines
5.6 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="task" />
|
||
|
<meta name="DC.Title" content="Change the values of variables" />
|
||
|
<meta name="abstract" content="You can change the values of variables while in debug mode." />
|
||
|
<meta name="description" content="You can change the values of variables while in debug mode." />
|
||
|
<meta name="DC.subject" content="CHGPGMVAR (Change Program Variable) command, Change Program Variable (CHGPGMVAR) command, command, CL, CHGPGMVAR (Change Program Variable), Change Program Variable (CHGPGMVAR), program variable, changing, variable, value in program, variable value, in program, automatic variable, program, static variable, description" />
|
||
|
<meta name="keywords" content="CHGPGMVAR (Change Program Variable) command, Change Program Variable (CHGPGMVAR) command, command, CL, CHGPGMVAR (Change Program Variable), Change Program Variable (CHGPGMVAR), program variable, changing, variable, value in program, variable value, in program, automatic variable, program, static variable, description" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="opm.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="../cl/chgpgmvar.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="../cl/chgptr.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="../cl/chghllptr.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="chgva" />
|
||
|
<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 values of variables</title>
|
||
|
</head>
|
||
|
<body id="chgva"><a name="chgva"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Change the values of variables</h1>
|
||
|
<div><p>You can change the values of variables while in debug mode.</p>
|
||
|
<div class="section"> <p>To change the value of a program variable, use the <span class="cmdname">Change
|
||
|
Program Variable (CHGPGMVAR)</span>, the <span class="cmdname">Change HLL Pointer (CHGHLLPTR)</span>,
|
||
|
or the <span class="cmdname">Change Pointer (CHGPTR)</span> command. Changing the value
|
||
|
of a program variable consists of specifying the variable name and a value
|
||
|
that is compatible with the data type of the variable. For example, if the
|
||
|
variable is character type, you must enter a character value.</p>
|
||
|
<p>When changing
|
||
|
the value of variables, you should be aware of whether the variable is an
|
||
|
automatic variable or a static variable. The difference between the two is
|
||
|
in the storage for the variables. For automatic variables, the storage is
|
||
|
associated with the call of the program. Every time a program is called,
|
||
|
a new copy of the variable is placed in automatic storage. A change to an
|
||
|
automatic variable remains in effect only for the program call the change
|
||
|
was made in. </p>
|
||
|
<div class="note"><span class="notetitle">Note:</span> In some languages, the definition of
|
||
|
a call is made at the procedure level and not just at the program level.
|
||
|
For these languages, storage for automatic variables is associated with the
|
||
|
call of the procedure. Every time a procedure is called, a new copy of the
|
||
|
variable is gotten. A change to an automatic variable remains in effect only
|
||
|
while that procedure is called. Only the automatic variables in the most
|
||
|
recent procedure call can be changed. The RCRLVL (recursion level) parameter
|
||
|
on the commands applies only on a program basis and not on a procedure basis.</div>
|
||
|
<p>For
|
||
|
static variables, the storage is associated with the activation. Only one
|
||
|
copy of a static variable exists in storage no matter how many times a program
|
||
|
is called. A change to a static variable remains in effect for the duration
|
||
|
of the activation.</p>
|
||
|
<p>To determine if a program variable is a static or
|
||
|
an automatic variable, request an intermediate representation of a program
|
||
|
(IRP) list (*LIST and *XREF on the GENOPT parameter) when the program containing
|
||
|
the variables is created.</p>
|
||
|
<p>When changing a variable that is an array,
|
||
|
you must specify one element of the array. Consequently, you must specify
|
||
|
the subscript values for the array element you want to change.</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="opm.htm" title="You can debug your OPM programs by using testing functions.">Debug OPM programs</a></div>
|
||
|
</div>
|
||
|
<div class="relinfo"><strong>Related information</strong><br />
|
||
|
<div><a href="../cl/chgpgmvar.htm">Change Program Variable (CHGPGMVAR) command</a></div>
|
||
|
<div><a href="../cl/chgptr.htm">Change Pointer (CHGPTR) command</a></div>
|
||
|
<div><a href="../cl/chghllptr.htm">Change HLL Pointer (CHGHLLPTR) command</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|