103 lines
6.2 KiB
HTML
103 lines
6.2 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="Parameters in keyword and positional form" />
|
||
|
<meta name="abstract" content="You can specify parameters in CL using keyword form, positional form, or in a combination of the two." />
|
||
|
<meta name="description" content="You can specify parameters in CL using keyword form, positional form, or in a combination of the two." />
|
||
|
<meta name="DC.Relation" scheme="URI" content="parameters.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbam6parms.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbam6gencodrulessum.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="rbam6key" />
|
||
|
<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>Parameters in keyword and positional form</title>
|
||
|
</head>
|
||
|
<body id="rbam6key"><a name="rbam6key"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Parameters in keyword and positional form</h1>
|
||
|
<div><p>You can specify parameters in CL using keyword form, positional
|
||
|
form, or in a combination of the two.</p>
|
||
|
<div class="section"><h4 class="sectiontitle">Parameters in keyword form</h4><p>A parameter in <em>keyword
|
||
|
form</em> consists of a keyword followed immediately by a value (or a list
|
||
|
of values separated by blank spaces) enclosed in parentheses. You cannot use
|
||
|
blanks between the keyword and the left parenthesis preceding the parameter
|
||
|
value. You can place blanks between the parentheses and the parameter value.
|
||
|
For example, LIB(MYLIB) is a keyword parameter specifying that MYLIB is the
|
||
|
name of the library that is used in some way, depending upon the command in
|
||
|
which this LIB parameter is used.</p>
|
||
|
<p>When command parameters are all specified
|
||
|
in keyword form, they can be placed in any order. For example, the following
|
||
|
two commands are the same:</p>
|
||
|
<pre>CRTLIB LIB(MYLIB) TYPE(*TEST)
|
||
|
CRTLIB TYPE(*TEST) LIB(MYLIB)</pre>
|
||
|
</div>
|
||
|
<div class="section"><h4 class="sectiontitle">Parameters in positional form</h4><p>A parameter in <em>positional
|
||
|
form</em> does not have its keyword coded; it contains only the value (or values,
|
||
|
if it is a list) whose function is determined by its position in the parameter
|
||
|
set for that command. The parameter values are separated from each other and
|
||
|
from the command name by one or more blank spaces. Because there is only one
|
||
|
positional sequence in which parameters can be coded, the positional form
|
||
|
of the previous CRTLIB (Create Library) command first example is:</p>
|
||
|
<pre>CRTLIB MYLIB *TEST</pre>
|
||
|
<p>If you do not want to enter a value for one of the parameters,
|
||
|
the predefined value *N (null) can be entered in that parameter's position.
|
||
|
The system recognizes *N as an omitted parameter, and either assigns a default
|
||
|
value or leaves it null. In the previous CRTLIB command second example, if
|
||
|
you coded *N instead of *TEST for the TYPE parameter, the default value *PROD
|
||
|
is used when the command is run, and a production library named MYLIB is created.
|
||
|
The description of the CRTLIB command contains the explanation for each parameter.</p>
|
||
|
<div class="note"><span class="notetitle">Note:</span> <ul><li>Parameters cannot be coded in positional form beyond the positional coding
|
||
|
limit. If you attempt to code parameters in positional form beyond that point,
|
||
|
the system returns an error message.</li>
|
||
|
<li> Using positional form in your CL program source may save time when writing
|
||
|
the program, but will be more difficult for you or someone else to maintain.
|
||
|
Commands written using keyword form are generally easier to understand and
|
||
|
enhance. </li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="section"><h4 class="sectiontitle">Combining keyword and positional forms</h4><p>A command
|
||
|
may also have its parameters coded in a combination of keyword and positional
|
||
|
forms. The following examples show three ways to code the Declare CL Variable
|
||
|
(DCL) command.</p>
|
||
|
<p>Keyword form:</p>
|
||
|
<pre>DCL VAR(&QTY) TYPE(*DEC) LEN(5) VALUE(0)</pre>
|
||
|
<p>Positional form:</p>
|
||
|
<pre>DCL &QTY *DEC 5 0</pre>
|
||
|
<p>Positional and keyword forms together:</p>
|
||
|
<pre>DCL &QTY *DEC VALUE(0)</pre>
|
||
|
<p>In the last example, because the optional LEN parameter was
|
||
|
not coded, the VALUE parameter <em>must</em> be coded in keyword form.</p>
|
||
|
<div class="note"><span class="notetitle">Note:</span> You
|
||
|
cannot specify parameters positionally after a parameter specified in keyword
|
||
|
form.</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="parameters.htm" title="A parameter is a value that is passed to a command or program to provide user input or control the actions of the command or program.">Parameters</a></div>
|
||
|
</div>
|
||
|
<div class="relconcepts"><strong>Related concepts</strong><br />
|
||
|
<div><a href="rbam6gencodrulessum.htm" title="This section contains a summary of general information needed to properly code CL commands.">Command coding rules</a></div>
|
||
|
</div>
|
||
|
<div class="relref"><strong>Related reference</strong><br />
|
||
|
<div><a href="rbam6parms.htm" title="Most CL commands have one or more parameters that specify the objects and values used to run the commands.">Command parameters</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|