316 lines
8.5 KiB
HTML
316 lines
8.5 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>Create Database Hash (qdbcrtha) 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. -->
|
||
|
<!-- Change History: -->
|
||
|
<!-- YYMMDD USERID Change description -->
|
||
|
<!-- File SCRIPT A converted by B2H R4.1 (346) (CMS) by V2KEA304 -->
|
||
|
<!-- at RCHVMW2 on 17 Feb 1999 at 11:05:09 -->
|
||
|
<!-- This file has undergone html cleanup on 9/20/01 by JET -->
|
||
|
<!-- Miscellaneous fixes on 05/01/13 by JET -->
|
||
|
<!--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 type="text/javascript" language="Javascript" src="../rzahg/synch.js">
|
||
|
</script>
|
||
|
|
||
|
<h2>Create Database Hash (qdbcrtha) API</h2>
|
||
|
|
||
|
<div class="box" style="width: 80%;">
|
||
|
<br>
|
||
|
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="50%">Hash name</td>
|
||
|
<td align="left" valign="top" width="20%">Input</td>
|
||
|
<td align="left" valign="top" width="20%">Char(10)</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td align="center" valign="top">2</td>
|
||
|
<td align="left" valign="top">Physical file</td>
|
||
|
<td align="left" valign="top">Input</td>
|
||
|
<td align="left" valign="top">Char(10)</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td align="center" valign="top">3</td>
|
||
|
<td align="left" valign="top">Physical file library</td>
|
||
|
<td align="left" valign="top">Input</td>
|
||
|
<td align="left" valign="top">Char(10)</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td align="center" valign="top">4</td>
|
||
|
<td align="left" valign="top">Logical file</td>
|
||
|
<td align="left" valign="top">Input</td>
|
||
|
<td align="left" valign="top">Char(10)</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td align="center" valign="top">5</td>
|
||
|
<td align="left" valign="top">Logical file library</td>
|
||
|
<td align="left" valign="top">Input</td>
|
||
|
<td align="left" valign="top">Char(10)</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td align="center" valign="top">6</td>
|
||
|
<td align="left" valign="top">Expression</td>
|
||
|
<td align="left" valign="top">Input</td>
|
||
|
<td align="left" valign="top">Char(64)</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td align="center" valign="top">7</td>
|
||
|
<td align="left" valign="top">Number-of-keys</td>
|
||
|
<td align="left" valign="top">Input</td>
|
||
|
<td align="left" valign="top">Binary(4)</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td align="center" valign="top">8</td>
|
||
|
<td align="left" valign="top">Key ranges</td>
|
||
|
<td align="left" valign="top">Input</td>
|
||
|
<td align="left" valign="top">Char(*)</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
|
||
|
<br>
|
||
|
Service Program Name: QDBCRTHA<br>
|
||
|
<!-- iddvc RMBR -->
|
||
|
<br>
|
||
|
Default Public Authority: *USE<br>
|
||
|
<!-- iddvc RMBR -->
|
||
|
<br>
|
||
|
Threadsafe: No<br>
|
||
|
<!-- iddvc RMBR -->
|
||
|
<br>
|
||
|
</div>
|
||
|
|
||
|
<p>The Create Database Hash (qdbcrtha) API sets up the environment
|
||
|
to enable the Run Database Hash (qdbrunha) API for a physical file that has a
|
||
|
uniquely keyed logical file built over it. The logical file may have up to five
|
||
|
integer keys associated with it. It is called as a function call of the form
|
||
|
'xx = qdbcrtha(parameter-list)', where xx is a long integer and the parameter
|
||
|
list is as defined here. The value of xx is set to a return code as defined in
|
||
|
the <a href="#HDRRVALUE">Returned Value</a> topic.</p>
|
||
|
|
||
|
<br>
|
||
|
|
||
|
<h3>Authorities and Locks</h3>
|
||
|
|
||
|
<dl compact>
|
||
|
<dt><em>HASH User Space in Library QUSRSYS</em></dt>
|
||
|
|
||
|
<dd>*OBJOPR, *READ, and *UPDATE</dd>
|
||
|
|
||
|
<dt><em>Library Authority</em></dt>
|
||
|
|
||
|
<dd>*EXECUTE</dd>
|
||
|
|
||
|
<dt><em>File Authority</em></dt>
|
||
|
|
||
|
<dd>*OBJOPR</dd>
|
||
|
|
||
|
<dt><em>File Lock</em></dt>
|
||
|
|
||
|
<dd>*SHRNUP</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
<h3>Required Parameter Group</h3>
|
||
|
|
||
|
<dl>
|
||
|
<dt><strong>Hash name</strong></dt>
|
||
|
|
||
|
<dd>INPUT; CHAR(10)
|
||
|
|
||
|
<p>The hash name to be created. A unique name must be selected for each hash
|
||
|
function that will be used on the system.</p>
|
||
|
</dd>
|
||
|
|
||
|
<dt><strong>Physical file</strong></dt>
|
||
|
|
||
|
<dd>INPUT; CHAR(10)
|
||
|
|
||
|
<p>The name of the physical file that will be accessed using the hash.</p>
|
||
|
</dd>
|
||
|
|
||
|
<dt><strong>Physical file library</strong></dt>
|
||
|
|
||
|
<dd>INPUT; CHAR(10)
|
||
|
|
||
|
<p>The name of the library where the physical file resides.</p>
|
||
|
</dd>
|
||
|
|
||
|
<dt><strong>Logical file</strong></dt>
|
||
|
|
||
|
<dd>INPUT; CHAR(10)
|
||
|
|
||
|
<p>The name of the logical file that will be used to build the hash. The
|
||
|
logical file must be uniquely keyed.</p>
|
||
|
</dd>
|
||
|
|
||
|
<dt><strong>Logical file library</strong></dt>
|
||
|
|
||
|
<dd>INPUT; CHAR(10)
|
||
|
|
||
|
<p>The name of the library where the logical file resides.</p>
|
||
|
</dd>
|
||
|
|
||
|
<dt><strong>Expression</strong></dt>
|
||
|
|
||
|
<dd>INPUT; CHAR(64)
|
||
|
|
||
|
<p>A valid mathematical expression that uses all the key values of a uniquely
|
||
|
keyed logical file to determine the hash value for a particular record. The
|
||
|
special value of *DFT can be used to allow the API to create an expression
|
||
|
based on expected cardinalities (number of expected unique values for each key)
|
||
|
of the keys in the logical file. Possible values are:</p>
|
||
|
|
||
|
<dl compact>
|
||
|
<dt><em>*DFT </em></dt>
|
||
|
|
||
|
<dd>The system default expression is used (requires the use of the number of
|
||
|
keys parameter and the key ranges parameter).</dd>
|
||
|
|
||
|
<dt><em>expression</em></dt>
|
||
|
|
||
|
<dd>The user-defined expression is used. For example: (where K1, K2, ... K5 are
|
||
|
the names of the key fields used in the logical file)</dd>
|
||
|
</dl>
|
||
|
|
||
|
<br>
|
||
|
</dd>
|
||
|
|
||
|
<dt><strong>Number of keys</strong></dt>
|
||
|
|
||
|
<dd>INPUT; BINARY(4)
|
||
|
|
||
|
<p>The number of keys used in the logical file.</p>
|
||
|
</dd>
|
||
|
|
||
|
<dt><strong>Key ranges</strong></dt>
|
||
|
|
||
|
<dd>INPUT; CHAR(*)
|
||
|
|
||
|
<p>A two-value structure with up to five occurrences, containing the names of
|
||
|
the key fields followed by the expected cardinality of the key. For more
|
||
|
details, see <a href="#HDRFIELDB">Field Descriptions</a>.<br>
|
||
|
</p>
|
||
|
|
||
|
<table border width="80%">
|
||
|
<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="center" valign="top" width="10%"></td>
|
||
|
<td align="center" valign="top" width="10%"></td>
|
||
|
<td align="left" valign="top" width="20%">CHAR(10)</td>
|
||
|
<td align="left" valign="top" width="60%">Name of key</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td align="center" valign="top"></td>
|
||
|
<td align="center" valign="top"></td>
|
||
|
<td align="left" valign="top">BINARY(4)</td>
|
||
|
<td align="left" valign="top">Cardinality</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
<br>
|
||
|
<h3><a name="HDRFIELDB">Field Descriptions</a></h3>
|
||
|
|
||
|
<p><strong>Name of key.</strong> The name of the key field that is used in the
|
||
|
logical file, which is referenced in this API. The names are for documentation
|
||
|
purposes only.</p>
|
||
|
|
||
|
<p><strong>Cardinality.</strong> The number of sequential values expected to be
|
||
|
used for each key, respectively. The cardinality values are required if *DFT
|
||
|
has been specified for the value of the expression parameter.<br>
|
||
|
</p>
|
||
|
|
||
|
<br>
|
||
|
<h3><a name="HDRRVALUE">Returned Value</a></h3>
|
||
|
|
||
|
<p>The returned value contains a numeric indication as to what took place
|
||
|
during the request to add a hash function. The possible values are:</p>
|
||
|
|
||
|
<dl compact>
|
||
|
<dt><em>0</em></dt>
|
||
|
|
||
|
<dd>No errors.</dd>
|
||
|
|
||
|
<dt><em>-2</em></dt>
|
||
|
|
||
|
<dd>The physical file has multiple formats. The create database hash function
|
||
|
cannot be completed.</dd>
|
||
|
|
||
|
<dt><em>-3</em></dt>
|
||
|
|
||
|
<dd>The logical file is not uniquely keyed. The create database hash function
|
||
|
cannot be completed.</dd>
|
||
|
|
||
|
<dt><em>-4</em></dt>
|
||
|
|
||
|
<dd>The logical file does not correlate to the physical file specified. The
|
||
|
create database hash function cannot be completed.</dd>
|
||
|
|
||
|
<dt><em>-5</em></dt>
|
||
|
|
||
|
<dd>The wrong number of keys was specified for the logical file. The create
|
||
|
database hash function cannot be completed.</dd>
|
||
|
|
||
|
<dt><em>-99</em></dt>
|
||
|
|
||
|
<dd>Another error was encountered and ignored. See job log for details.</dd>
|
||
|
</dl>
|
||
|
|
||
|
<br>
|
||
|
<h3>Error Messages</h3>
|
||
|
|
||
|
<p>Only the error conditions listed in the <a href="qdbcrtha.htm#HDRRVALUE">
|
||
|
Returned Value</a> are monitored. No error messages other than the value of the
|
||
|
return code parameter are returned.</p>
|
||
|
|
||
|
<hr>
|
||
|
API introduced: V4R3
|
||
|
|
||
|
<hr>
|
||
|
<center>
|
||
|
<table cellpadding="2" cellspacing="2" width="600">
|
||
|
<tr align="center">
|
||
|
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> | <a href=
|
||
|
"file1.htm">Database and File APIs</a> | <a href="aplist.htm">APIs by
|
||
|
category</a></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</center>
|
||
|
</body>
|
||
|
</html>
|
||
|
|