130 lines
9.5 KiB
HTML
130 lines
9.5 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="Use variables" />
|
|
<meta name="abstract" content="CL procedures consist of CL commands, and the commands themselves consist of the command statement, parameters, and parameter values." />
|
|
<meta name="description" content="CL procedures consist of CL commands, and the commands themselves consist of the command statement, parameters, and parameter values." />
|
|
<meta name="DC.subject" content="variable, working with, definition, creating object, object, creating, using variable, DCLF (Declare File) command, description, Declare File (DCLF) command, command, CL, DCLF (Declare File), variables, command, CL, Declare File (DCLF), file, declaring, name" />
|
|
<meta name="keywords" content="variable, working with, definition, creating object, object, creating, using variable, DCLF (Declare File) command, description, Declare File (DCLF) command, command, CL, DCLF (Declare File), variables, command, CL, Declare File (DCLF), file, declaring, name" />
|
|
<meta name="DC.Relation" scheme="URI" content="clpro.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="declv.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="basedv.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="definedv.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="usvar.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="lower.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="varrr.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="valuv.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="tralb.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="clpms.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="cflow.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="wmddf.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="contp.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="allow.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="excmd.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="execp.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="dataerrorc.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="workv" />
|
|
<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>Use variables</title>
|
|
</head>
|
|
<body id="workv"><a name="workv"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Use variables</h1>
|
|
<div><p>CL procedures consist of CL commands, and the commands themselves
|
|
consist of the command statement, parameters, and parameter values.</p>
|
|
<div class="section"> <p>Parameter values may be expressed as variables,
|
|
constants, or expressions. A <strong>variable</strong> is a named changeable value
|
|
that can be accessed or changed by referring to its name. Variables can be
|
|
used as substitutes for most parameter values on CL commands. When a CL variable
|
|
is specified as a parameter value and the command containing it is run, the
|
|
value of the variable is used as the parameter value. Every time the command
|
|
is run, a different value can be substituted for the variable. Variables
|
|
and expressions can be used as parameter values only in CL procedures and
|
|
programs.</p>
|
|
<p>Variables are not stored in libraries; they are not objects;
|
|
and their values are destroyed when the procedure that contains them is no
|
|
longer active. The use of variables as values gives CL programming a special
|
|
flexibility, because this allows high-level manipulation of objects whose
|
|
content may change by specific applications. You might, for instance, write
|
|
a CL procedure to direct the processing of other programs or the operation
|
|
of several workstations without specifying which programs or workstations
|
|
are to be controlled. The system identifies these as variables in the CL
|
|
procedure. You can define (specify) the value of the variables when running
|
|
the CL procedure.</p>
|
|
<p>In addition to the uses discussed in this section,
|
|
variables can be used to: </p>
|
|
<ul><li>Pass information between procedures and jobs.</li>
|
|
<li>Pass information between procedures and device displays.</li>
|
|
<li>Conditionally process commands.</li>
|
|
<li>Create objects. A variable can be used in place of an object name or
|
|
library name, or both. The following example shows the <span class="cmdname">Create Physical
|
|
File (CRTPF)</span> command used with a specified library in the first
|
|
line, and with a variable replacing the library name in the second line: <pre>CRTPF FILE(DSTPRODLB/&FILE)
|
|
CRTPF FILE(&LIB/&FILE)</pre>
|
|
</li>
|
|
</ul>
|
|
<p>Variables cannot be used to change a command name or keyword or to
|
|
specify a procedure name for the CALLPRC command. Command parameters, however,
|
|
can be changed during the processing of a CL procedure through the use of
|
|
the prompting function.</p>
|
|
<p>It is also possible to assemble the keywords
|
|
and parameters for a command and process it using the QCAPCMD API or QCMDEXC
|
|
API.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<ul class="ullinks">
|
|
<li class="ulchildlink"><strong><a href="declv.htm">Declare a variable</a></strong><br />
|
|
All variables must be declared (defined) to the CL procedure before they can be used by the procedure.</li>
|
|
<li class="ulchildlink"><strong><a href="basedv.htm">Use based variables</a></strong><br />
|
|
Based variables can be used to map variables passed to the program or manipulate arrays of values.</li>
|
|
<li class="ulchildlink"><strong><a href="definedv.htm">Use defined variables</a></strong><br />
|
|
Defined variables make it easy to manage complex data structures in CL by eliminating the need to substring values out of a large variable.</li>
|
|
<li class="ulchildlink"><strong><a href="usvar.htm">Specify a list or qualified name using a variable</a></strong><br />
|
|
Variables can be used to specify a list or qualified name.</li>
|
|
<li class="ulchildlink"><strong><a href="lower.htm">Case of characters in variables</a></strong><br />
|
|
There are restrictions on the case used for characters in variables.</li>
|
|
<li class="ulchildlink"><strong><a href="varrr.htm">Variables replacing reserved or numeric parameter values</a></strong><br />
|
|
Character variables can be used for some commands to represent a value on the command parameter.</li>
|
|
<li class="ulchildlink"><strong><a href="valuv.htm">Change the value of a variable</a></strong><br />
|
|
You can change the value of a CL variable using the <span class="cmdname">Change
|
|
Variable (CHGVAR)</span> command. </li>
|
|
<li class="ulchildlink"><strong><a href="tralb.htm">Trailing blanks on command parameters</a></strong><br />
|
|
This describes how trailing blanks are handled on command parameters.</li>
|
|
<li class="ulchildlink"><strong><a href="clpms.htm">Write comments in CL procedures</a></strong><br />
|
|
This describes how to write comments in CL procedures.</li>
|
|
</ul>
|
|
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="clpro.htm" title="This provides tasks and concepts specific to CL programming.">CL programming</a></div>
|
|
</div>
|
|
<div class="reltasks"><strong>Related tasks</strong><br />
|
|
<div><a href="cflow.htm" title="You can use the Call Program (CALL), Call Bound Procedure (CALLPRC), and Return (RETURN) commands to pass control back and forth between programs and procedures.">Control flow and communicate between programs and procedures</a></div>
|
|
<div><a href="wmddf.htm" title="The normal mode of operation on a system is for the workstation user to sign on and become the requester for an interactive job. Many users can do this at the same time, because each will use a logical copy of the procedure, including the display file in the procedure. Each requester calls a separate job in this kind of use. This is not considered to be multiple device display use.">Work with multiple device display files</a></div>
|
|
<div><a href="allow.htm" title="You can prompt the workstation user for input to a CL procedure or program.">Prompt for user input at runtime</a></div>
|
|
<div><a href="excmd.htm" title="The Process Commands (QCAPCMD) API performs command analyzer processing on command strings.">QCAPCMD program</a></div>
|
|
<div><a href="execp.htm" title="Execute Command (QCMDEXC) is an IBM-supplied program that runs a single command.">QCMDEXC program</a></div>
|
|
<div><a href="dataerrorc.htm" title="This details the types of data type errors that may occur when using the Call (CALL) command.">Data type errors using the CALL command</a></div>
|
|
</div>
|
|
<div class="relref"><strong>Related reference</strong><br />
|
|
<div><a href="contp.htm" title="You can use commands to change the flow of logic within your CL procedure.">Control processing within a CL procedure</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |