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

120 lines
6.8 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="Use CL or HLL for simple lists" />
<meta name="abstract" content="This describes the format in which elements in a simple list are passed when a command is run using CL or a high-level language." />
<meta name="description" content="This describes the format in which elements in a simple list are passed when a command is run using CL or a high-level language." />
<meta name="DC.subject" content="simple list, using CL or HLL for, list, CL or HLL for simple" />
<meta name="keywords" content="simple list, using CL or HLL for, list, CL or HLL for simple" />
<meta name="DC.Relation" scheme="URI" content="dslst.htm" />
<meta name="DC.Relation" scheme="URI" content="defpr.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="defslclhll" />
<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 CL or HLL for simple lists</title>
</head>
<body id="defslclhll"><a name="defslclhll"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Use CL or HLL for simple lists</h1>
<div><p>This describes the format in which elements in a simple list are
passed when a command is run using CL or a high-level language.</p>
<div class="section"> <p>When the command is run using CL or HLL, the elements in a simple
list are passed to the command processing program in the following format.</p>
<br /><img src="rbafn509.gif" alt="When the command is run using CL or HLL, the elements in a simple list are passed to the command processing program in this format." /><br /><p>The number of values passed
is specified by a binary value that is two characters long. This number indicates
how many values were actually entered (are being passed), not how many can
be specified. The values are passed by the type of parameter just as a value
of a single parameter is passed. For example, if two user names
(BJONES and TBROWN) are specified for the USER parameter, the following is
passed.</p>
<br /><img src="rbafn510.gif" alt="If two user names (BJONES and TBROWN) are specified for the USER parameter this is passed." /><br /><p>The user names are passed
as 10-character values that are left-adjusted and padded with blanks.</p>
<p>When
a simple list is passed, only the number of elements specified on the command
are passed. The storage immediately following the last element passed is
not part of the list and must not be referred to as part of the list. Therefore,
when the command processing program (CPP) processes a simple list, it uses
the number of elements passed to determine how many elements can be processed.</p>
<p>The
example below shows a CL procedure using the binary built-in function to process
a simple list.</p>
<div class="fignone" id="defslclhll__xslcl"><a name="defslclhll__xslcl"><!-- --></a><span class="figcap">Figure 1. Simple List Example</span><pre> PGM PARM (...&amp;USER..)
.
.
.
/* Declare space for a simple list of up to five */
/* 10-character values to be received */
DCL VAR(&amp;USER) TYPE(*CHAR) LEN(52)
.
DCL VAR(&amp;CT) TYPE(*DEC) LEN(3 0)
DCL VAR(&amp;USER1) TYPE(*CHAR) LEN(10)
DCL VAR(&amp;USER2) TYPE(*CHAR) LEN(10)
DCL VAR(&amp;USER3) TYPE(*CHAR) LEN(10)
DCL VAR(&amp;USER4) TYPE(*CHAR) LEN(10)
DCL VAR(&amp;USER5) TYPE(*CHAR) LEN(10)
.
.
.
CHGVAR VAR(&amp;CT) VALUE(%BINARY(&amp;USER 1 2))
.
IF (&amp;CT &gt; 0) THEN(CHGVAR &amp;USER1 %SST(&amp;USER 3 10))
IF (&amp;CT &gt; 1) THEN(CHGVAR &amp;USER2 %SST(&amp;USER 13 10))
IF (&amp;CT &gt; 2) THEN(CHGVAR &amp;USER3 %SST(&amp;USER 23 10))
IF (&amp;CT &gt; 3) THEN(CHGVAR &amp;USER4 %SST(&amp;USER 33 10))
IF (&amp;CT &gt; 4) THEN(CHGVAR &amp;USER5 %SST(&amp;USER 43 10))
IF (&amp;CT &gt; 5) THEN(DO)
/* If CT is greater than 5, the values passed */
/* is greater than the program expects, and error */
/* logic should be performed */
.
.
.
ENDDO
ELSE DO
/* The correct number of values are passed */
/* and the program can continue processing */
.
.
.
ENDDO
ENDPGM</pre>
</div>
<p>This same technique can be used to process other lists in a CL procedure
or program.</p>
<p>For a simple list, a single value such as *ALL or *NONE
can be entered on the command instead of the list. Single values are passed
as an individual value. Similarly, if no values are specified for a parameter,
the default value, if any is defined, is passed as the only value in the list.
For example, if the default value *ALL is used for the USER parameter, the
following is passed.</p>
<br /><img src="rbafn511.gif" alt="In this example the following is passed when the default value *ALL is used for the USER parameter." /><br /><p>*ALL is passed as a 10-character
value that is left-adjusted and padded with blanks.</p>
<p>If no default value
is defined for an optional simple list parameter, the following is passed:</p>
<br /><img src="rbafn512.gif" alt="In this example the following is passed if no default value is defined for an optional simple list parameter." /><br /></div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dslst.htm" title="A simple list can accept one or more values of the type specified by the parameter.">Define a simple list</a></div>
</div>
<div class="reltasks"><strong>Related tasks</strong><br />
<div><a href="defpr.htm" title="To define a parameter, you must use the PARM statement.">Define parameters</a></div>
</div>
</div>
</body>
</html>