ibm-information-center/dist/eclipse/plugins/i5OS.ic.apis_5.4.0.1/qusaddui.htm

508 lines
14 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
<title>Add User Index Entries (QUSADDUI) API</title>
<!-- Begin Header Records ========================================== -->
<!-- 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. -->
<!-- QUSADDUI SCRIPT A converted by B2H R4.1 (346) (CMS) by PMHALL at -->
<!-- RCHVMW2 on 7 Oct 1998 at 22:30:19 -->
<!-- Change History: -->
<!-- YYMMDD USERID Change description -->
<!-- Edited by Kersten Jan 02 -->
<!--End Header Records -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<a name="Top_Of_Page"></a>
<!-- Java sync-link -->
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript">
</script>
<h2>Add User Index Entries (QUSADDUI) API</h2>
<div class="box" style="width: 80%;">
<br>
&nbsp;&nbsp;Required Parameter Group:<br>
<!-- iddvc RMBR -->
<br>
<table width="100%">
<tr>
<td align="center" valign="top" width="10%">1</td>
<td align="left" valign="top" width="45%">Returned library name</td>
<td align="left" valign="top" width="20%">Output</td>
<td align="left" valign="top" width="25%">Char(10)</td>
</tr>
<tr>
<td align="center" valign="top">2</td>
<td align="left" valign="top">Number of entries added</td>
<td align="left" valign="top">Output</td>
<td align="left" valign="top">Binary(4)</td>
</tr>
<tr>
<td align="center" valign="top">3</td>
<td align="left" valign="top">Qualified user index name</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Char(20)</td>
</tr>
<tr>
<td align="center" valign="top">4</td>
<td align="left" valign="top">Insert type</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Binary(4)</td>
</tr>
<tr>
<td align="center" valign="top">5</td>
<td align="left" valign="top">Index entries</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Char(*)</td>
</tr>
<tr>
<td align="center" valign="top">6</td>
<td align="left" valign="top">Length of index entries</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Binary(4)</td>
</tr>
<tr>
<td align="center" valign="top">7</td>
<td align="left" valign="top">Entry lengths and offsets</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Array(*) of Char(8)</td>
</tr>
<tr>
<td align="center" valign="top">8</td>
<td align="left" valign="top">Number of entries</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Binary(4)</td>
</tr>
<tr>
<td align="center" valign="top">9</td>
<td align="left" valign="top">Error code</td>
<td align="left" valign="top">I/O</td>
<td align="left" valign="top">Char(*)</td>
</tr>
</table>
<br>
&nbsp;&nbsp;Default Public Authority: *USE<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Threadsafe: Yes<br>
<!-- iddvc RMBR -->
<br>
</div>
<p>The Add User Index Entries (QUSADDUI) API inserts one or more entries into
the user index by the insert type. Each entry is inserted into the index at the
appropriate location based on the binary value of the entry. No other collating
sequence is supported. Every entry added causes the number of entries added
parameter to be incremented by 1; you can retrieve the current number of
entries added by using the Retrieve User Index Attributes (QUSRUIAT) API.</p>
<p>When you request to add multiple entries to a user index, the request may be
partially successful in the following situations:</p>
<ul>
<li>One or more of the entries you requested to add already exists in the
index.</li>
<li>The index becomes full as the entries are added.</li>
<li>The user profile storage limit is exceeded as entries are added.</li>
<li>One or more of the entry lengths or offsets are not valid.</li>
</ul>
<p>When an error occurs, you should check the number of entries added parameter
to see if all entries were successfully added. If the number of entries added
parameter and the number of entries parameter are not equal, then all entries
were not added.</p>
<p><strong>Note:</strong>If you add new entries with an entry length longer
than the user index is expecting, the entries are truncated to the right. No
error is given.</p>
<p>If you are using a fixed length index and the entries you are adding are
less than the fixed length, you may get undesirable results. The entries are
not padded with blanks before being entered into the user index. The API checks
the length of index entries parameter to ensure that the length you pass is a
multiple of the length of one index entry.</p>
<br>
<h3>Authorities and Locks</h3>
<dl>
<dt><em>User Index Library Authority</em></dt>
<dd>*EXECUTE</dd>
<dt><em>User Index Authority</em></dt>
<dd>*CHANGE</dd>
<dt><em>User Index Lock</em></dt>
<dd>*SHRUPD</dd>
</dl>
<br>
<h3>Required Parameter Group</h3>
<dl>
<dt><strong>Returned library name</strong></dt>
<dd>OUTPUT; CHAR(10)
<p>The name of the library that contains the user index to which the entries
were added if they were added successfully. This parameter is not set if no
entries were successfully added. This information helps you identify the
specific library used when *LIBL or *CURLIB is specified in the qualified user
index name parameter.</p>
</dd>
<dt><strong>Number of entries added</strong></dt>
<dd>OUTPUT; BINARY(4)
<p>The number of entries successfully added to the specified user index. If an
error is received while processing the entries, this number indicates how many
were added before the error occurred.</p>
</dd>
<dt><strong>Qualified user index name</strong></dt>
<dd>INPUT; CHAR(20)
<p>The user index to which you want to add entries and the library in which it
is located. The first 10 characters contain the user index name, and the second
10 characters contain the library name.</p>
<p>You can use these special values for the library name:</p>
<table cellpadding="5">
<!-- cols="15 85" -->
<tr>
<td valign="top"><em>*CURLIB</em></td>
<td valign="top">The job's current library</td>
</tr>
<tr>
<td valign="top"><em>*LIBL</em></td>
<td valign="top">The library list</td>
</tr>
</table>
<br>
</dd>
<dt><strong>Insert type</strong></dt>
<dd>INPUT; BINARY(4)
<p>The type of insert to be performed against all entries that are to be
added.</p>
<p>Valid values are:</p>
<table cellpadding="5">
<!-- cols="5 95" -->
<tr>
<td valign="top"><em>1</em></td>
<td valign="top">Insert unique argument
<p>This value is only valid for nonkeyed user indexes. If the entry is already
in the index or the index entries are keyed, an error is returned.</p>
</td>
</tr>
<tr>
<td valign="top"><em>2</em></td>
<td valign="top">Insert with replacement
<p>This value requests to replace the nonkey portion of the index entry if the
key is already in the user index. It is only valid for keyed user indexes. If
the entry does not exist, it will be inserted into the user index. If the index
entries are nonkeyed, an error is returned.</p>
</td>
</tr>
<tr>
<td valign="top"><em>3</em></td>
<td valign="top">Insert without replacement
<p>This value requests to insert the entry only if the key is not already in
the user index. It is only valid for a keyed user index. If the entry does not
exist, it will be inserted into the user index. If the entry is already in the
index or the index entries are nonkeyed, an error is returned.</p>
</td>
</tr>
</table>
<br>
</dd>
<dt><strong>Index entries</strong></dt>
<dd>INPUT; CHAR(*)
<p>The actual entry or entries to be added to the user index. If the user index
contains <em>fixed length</em> entries, this parameter is processed using the
entry length specified when the user index was created. If the user index
contains <em>variable length</em> entries, this parameter is processed using
the information contained in the entry lengths and entry offsets parameter.</p>
<p>When using an index that contains fixed length entries, this parameter
should be the same length as the length of index entries parameter.</p>
</dd>
<dt><strong>Length of index entries</strong></dt>
<dd>INPUT; BINARY(4)
<p>The length of the index entries parameter. This value must be greater than
0.</p>
</dd>
<dt><strong>Entry lengths and entry offsets</strong></dt>
<dd>INPUT; ARRAY(*) of CHAR(8)
<p>If the user index contains variable length entries, this parameter is a
data-structure array that is used to parse through the index entries parameter.
In this case, an entry length and entry offset need to be provided for all
entries that are to be added. This parameter is ignored for user indexes
containing fixed length entries.</p>
<p>The size of the entry lengths and entry offsets parameter must be at least
eight times the number of entries parameter; otherwise, an error will be
returned.</p>
<p>See <a href="#HDRADD02">Format for Entry Lengths and Entry Offsets</a> for
details on the data structure.</p>
</dd>
<dt><strong>Number of entries</strong></dt>
<dd>INPUT; BINARY(4)
<p>The number of entries that are to be added to the user index. Valid values
are 1 through 4095.</p>
</dd>
<dt><strong>Error code</strong></dt>
<dd>I/O; CHAR(*)
<p>The structure in which to return error information. For the format of the
structure, see <a href="../apiref/error.htm#hdrerrcod">Error Code Parameter</a>.</p>
</dd>
</dl>
<br>
<h3><a name="HDRADD02">Format for Entry Lengths and Entry Offsets</a></h3>
<p>The following table defines the format for the entry lengths and entry
offsets parameter. This information is needed to parse through the index
entries parameter.For detailed descriptions of the fields in the table, see <a
href="#HDRADD03">Field Descriptions</a>.</p>
<table border width="80%">
<!-- cols="10 10 20 60" -->
<tr>
<th align="center" valign="bottom" colspan="2">Offset</th>
<th align="left" valign="bottom" rowspan="2">Type</th>
<th align="left" valign="bottom" rowspan="2">Field</th>
</tr>
<tr>
<th align="center" valign="bottom">Dec</th>
<th align="center" valign="bottom">Hex</th>
</tr>
<tr>
<td align="left" valign="top" colspan="4"><strong>Note:</strong> The following
fields will be repeated. The number of times they are repeated depends on the
value specified in the number of entries parameter.</td>
</tr>
<tr>
<td align="left" valign="top" width="10%">&nbsp;</td>
<td align="left" valign="top" width="10%">&nbsp;</td>
<td align="left" valign="top" width="20%">BINARY(4)</td>
<td align="left" valign="top" width="60%">Entry length</td>
</tr>
<tr>
<td align="left" valign="top">&nbsp;</td>
<td align="left" valign="top">&nbsp;</td>
<td align="left" valign="top">BINARY(4)</td>
<td align="left" valign="top">Entry offset</td>
</tr>
</table>
<br>
<br>
<h3><a name="HDRADD03">Field Descriptions</a></h3>
<p><strong>Entry length</strong> The length of the entry to be inserted into
the index. Valid values are 1-2000. This value depends on how the user index
was created.</p>
<p><strong>Entry offset.</strong> For the first entry, the offset is the number
of bytes from the beginning of the index entries parameter to the first byte of
the first entry. For each subsequent entry, the offset is the number of bytes
from the beginning of the previous entry to the first byte of the next entry.
Each entry offset value must be greater than or equal to 0 and must refer to an
entry within the index entries parameter.</p>
<br>
<h3>Error Messages</h3>
<table width="100%" cellpadding="5">
<!-- cols="15 85" -->
<tr>
<th align="left" valign="top">Message ID</th>
<th align="left" valign="top">Error Message Text</th>
</tr>
<tr>
<td width="15%" valign="top">CPF24B4 E</td>
<td width="85%" valign="top">Severe error while addressing parameter list.</td>
</tr>
<tr>
<td valign="top">CPF3CF1 E</td>
<td valign="top">Error code parameter not valid.</td>
</tr>
<tr>
<td valign="top">CPF3C7B E</td>
<td valign="top">Length of index entries is not valid.</td>
</tr>
<tr>
<td valign="top">CPF3C7C E</td>
<td valign="top">User index is full.</td>
</tr>
<tr>
<td valign="top">CPF3C71 E</td>
<td valign="top">Insert type &amp;1 is not valid.</td>
</tr>
<tr>
<td valign="top">CPF3C72 E</td>
<td valign="top">Number of entries &amp;1 is not valid.</td>
</tr>
<tr>
<td valign="top">CPF3C73 E</td>
<td valign="top">Error occurred with index entries parameter.</td>
</tr>
<tr>
<td valign="top">CPF3C74 E</td>
<td valign="top">Entry is already in the index.</td>
</tr>
<tr>
<td valign="top">CPF3C75 E</td>
<td valign="top">Error occurred with entry lengths and offsets parameter.</td>
</tr>
<tr>
<td valign="top">CPF8100 E</td>
<td valign="top">All CPF81xx messages could be returned. xx is from 01 to
FF.</td>
</tr>
<tr>
<td valign="top">CPF9801 E</td>
<td valign="top">Object &amp;2 in library &amp;3 not found.</td>
</tr>
<tr>
<td valign="top">CPF9802 E</td>
<td valign="top">Not authorized to object &amp;2 in &amp;3.</td>
</tr>
<tr>
<td valign="top">CPF9803 E</td>
<td valign="top">Cannot allocate object &amp;2 in library &amp;3.</td>
</tr>
<tr>
<td valign="top">CPF9807 E</td>
<td valign="top">One or more libraries in library list deleted.</td>
</tr>
<tr>
<td valign="top">CPF9808 E</td>
<td valign="top">Cannot allocate one or more libraries on library list.</td>
</tr>
<tr>
<td valign="top">CPF9810 E</td>
<td valign="top">Library &amp;1 not found.</td>
</tr>
<tr>
<td valign="top">CPF9820 E</td>
<td valign="top">Not authorized to use library &amp;1.</td>
</tr>
<tr>
<td valign="top">CPF9830 E</td>
<td valign="top">Cannot assign library &amp;1.</td>
</tr>
<tr>
<td valign="top">CPF9838 E</td>
<td valign="top">User profile storage limit exceeded.</td>
</tr>
<tr>
<td valign="top">CPF9872 E</td>
<td valign="top">Program or service program &amp;1 in library &amp;2 ended.
Reason code &amp;3.</td>
</tr>
</table>
<br>
<hr>
API introduced: V2R3
<hr>
<table cellpadding="2" cellspacing="2" align="center">
<tr align="center">
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> | <a href=
"obj1.htm">Object API categories</a> | <a href="aplist.htm">API by
category</a></td>
</tr>
</table>
</body>
</html>