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

620 lines
20 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>Check Spelling (QTWCHKSP) 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 -->
<!-- NETMG2 SCRIPT A converted by B2H R4.1 (346) (CMS) by HOLTJM at -->
<!-- RCHVMW2 on 29 Jan 1999 at 10:01:37 -->
<!--File Edited October 2001 -->
<!--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>Check Spelling (QTWCHKSP) API</h2>
<div class="box" style="width: 75%;">
<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="50%">Receiver variable</td>
<td align="left" valign="top" width="20%">Output</td>
<td align="left" valign="top" width="20%">Char(*)</td>
</tr>
<tr>
<td align="center" valign="top">2</td>
<td align="left" valign="top">Length of receiver variable</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Binary(4)</td>
</tr>
<tr>
<td align="center" valign="top">3</td>
<td align="left" valign="top">Format name</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Char(8)</td>
</tr>
<tr>
<td align="center" valign="top">4</td>
<td align="left" valign="top">Word list</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Char(*)</td>
</tr>
<tr>
<td align="center" valign="top">5</td>
<td align="left" valign="top">Length of word list</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Binary(4)</td>
</tr>
<tr>
<td align="center" valign="top">6</td>
<td align="left" valign="top">Input dictionaries</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Char(*)</td>
</tr>
<tr>
<td align="center" valign="top">7</td>
<td align="left" valign="top">Length of input dictionaries</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">Output dictionaries</td>
<td align="left" valign="top">Output</td>
<td align="left" valign="top">Char(*)</td>
</tr>
<tr>
<td align="center" valign="top">9</td>
<td align="left" valign="top">Length of output dictionaries</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Binary(4)</td>
</tr>
<tr>
<td align="center" valign="top">10</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: No<br>
<!-- iddvc RMBR -->
<br>
</div>
<p>The Check Spelling (QTWCHKSP) API accepts a list of one or more words in the word list parameter, and returns one word array entry in the receiver variable for every word with an indication if it is a valid word. To retrieve additional information about a specific word, see the <a href= "QTWAIDSP.htm">Aid Spelling (QTWAIDSP) API</a>.</p>
<p>The QTWCHKSP API can be used to do the following:</p>
<ul>
<li>Check the spelling of an individual word</li>
<li>Find misspelled words in a character string</li>
</ul>
<p>To perform the function, a user can specify a maximum of eight IBM or user language dictionaries in the input dictionaries parameter.</p>
<br>
<h3>Authorities and Locks</h3>
<dl>
<dt><em>Dictionary Authority</em></dt>
<dd>*USE</dd>
<dt><em>Dictionary Library Authority</em></dt>
<dd>*USE</dd>
<dt><em>Dictionary Lock Authority</em></dt>
<dd>*SHRNUP</dd>
</dl>
<br>
<h3>Required Parameter Group</h3>
<dl>
<dt><strong>Receiver variable</strong></dt>
<dd>OUTPUT; CHAR(*)
<p>The variable that is to receive the information about each word in the word list. You can specify the size of this area to be smaller than necessary to hold information about each word as long as you specify the length parameter correctly. As a result, the API returns only the data that the area can hold. The minimum size of this area is eight bytes.</p>
</dd>
<dt><strong>Length of receiver variable</strong></dt>
<dd>INPUT; BINARY(4)
<p>The length of the receiver variable. If the length is larger than the size of the receiver variable, the results may not be predictable. The minimum length is 8 bytes.</p>
</dd>
<dt><strong>Format name</strong></dt>
<dd>INPUT; CHAR(8)
<p>The content and format of the information returned in the receiver variable. For more information on the format see <a href="#HDRCHKF">CHKW0100 and CHKW0200 Formats</a>. The following are possible format names:</p>
<table cellpadding="3">
<!-- cols="15 85" -->
<tr>
<td valign="top"><em>CHKW0100</em></td>
<td valign="top">Word array entries for only the misspelled words should be returned in the receiver variable.</td>
</tr>
<tr>
<td valign="top"><em>CHKW0200</em></td>
<td valign="top">Word array entries for all words in the word list should be returned.</td>
</tr>
</table>
<br>
</dd>
<dt><strong>Word list</strong></dt>
<dd>INPUT; CHAR(*)
<p>A list of one or more words to be checked. The words must be separated by one or more word separators where the blank character is always considered a word separator. The CCSID of the current job determines what code page will be used and each code page defines what other characters can be used as word separators. Refer to the <a href="../nls/rbagsglobalmain.htm">Globalization</a> topic in the iSeries Information Center for more information on CCSIDs. Refer to <a href="off1a.htm#HDRWRDLST">Word Separator Tables</a> for information on word separators.</p>
</dd>
<dt><strong>Length of word list</strong></dt>
<dd>INPUT; BINARY(4)
<p>The length of the word list in bytes.</p>
</dd>
<dt><strong>Input dictionaries</strong></dt>
<dd>INPUT; CHAR(*)
<p>A structure containing a list of up to eight dictionaries to be used to determine if the word or words in the word list are spelled correctly. For the format of this parameter, see <a href="#HDRINDF">Input Dictionaries Format</a>.</p>
</dd>
<dt><strong>Length of input dictionaries</strong></dt>
<dd>INPUT; BINARY(4)
<p>The length of the input dictionaries parameter. The only valid value is 172 bytes.</p>
</dd>
<dt><strong>Output dictionaries</strong></dt>
<dd>OUTPUT; CHAR(*)
<p>A structure containing a list of up to eight dictionaries that were actually used. For the format of this parameter, see <a href="#HDROUTDF">Output Dictionaries Format</a>.</p>
</dd>
<dt><strong>Length of output dictionaries</strong></dt>
<dd>INPUT; BINARY(4)
<p>The length of the output dictionaries parameter. The following are valid values:</p>
<table cellpadding="3">
<!-- cols="5 95" -->
<tr>
<td valign="top"><em>0</em></td>
<td valign="top">No dictionaries are returned in the output dictionaries parameter.</td>
</tr>
<tr>
<td valign="top"><em>&gt;0</em></td>
<td valign="top">The length of space available in the output dictionaries parameter. If this length is larger than the actual size of the output dictionaries parameter, the results may not be predictable.</td>
</tr>
</table>
<br>
</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="HDRCHKF">CHKW0100 and CHKW0200 Formats</a></h3>
<p>The following information is returned for both the CHKW0100 and CHKW0200 formats. If the receiver variable is large enough to hold all the information, then it contains information about each word in the word list.</p>
<p>The receiver variable has three logical sections which contain:</p>
<ul>
<li>Fixed section</li>
<li>Word information entry</li>
<li>An array of the actual input words</li>
</ul>
<p>For more detailed descriptions of the fields in the table, see <a href="#HDRCHK">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> Fixed
section.</td>
</tr>
<tr>
<td align="center" valign="top" width="10%">0</td>
<td align="center" valign="top" width="10%">0</td>
<td align="left" valign="top" width="20%">BINARY(4)</td>
<td align="left" valign="top" width="60%">Bytes returned</td>
</tr>
<tr>
<td align="center" valign="top">4</td>
<td align="center" valign="top">4</td>
<td align="left" valign="top">BINARY(4)</td>
<td align="left" valign="top">Bytes available</td>
</tr>
<tr>
<td align="center" valign="top">8</td>
<td align="center" valign="top">8</td>
<td align="left" valign="top">BINARY(4)</td>
<td align="left" valign="top">Number of words returned</td>
</tr>
<tr>
<td align="center" valign="top">12</td>
<td align="center" valign="top">C</td>
<td align="left" valign="top">BINARY(4)</td>
<td align="left" valign="top">Number of words available</td>
</tr>
<tr>
<td align="center" valign="top">16</td>
<td align="center" valign="top">10</td>
<td align="left" valign="top">BINARY(4)</td>
<td align="left" valign="top">Offset to first word information entry</td>
</tr>
<tr>
<td align="center" valign="top">20</td>
<td align="center" valign="top">14</td>
<td align="left" valign="top">BINARY(4)</td>
<td align="left" valign="top">Length of word information entry</td>
</tr>
<tr>
<td align="center" valign="top">24</td>
<td align="center" valign="top">18</td>
<td align="left" valign="top">BINARY(4)</td>
<td align="left" valign="top">Reserved</td>
</tr>
<tr>
<td align="left" valign="top" colspan="4"><strong>Note:</strong> Format of a word information entry. The following four fields are repeated for each word returned. The first word information entry is found by using the offset to first word information entry in the fixed section. Each subsequent word information entry is found by adding the length of a word information entry to the offset of the previous word information entry.</td>
</tr>
<tr>
<td align="center" valign="top">&nbsp;</td>
<td align="center" valign="top">&nbsp;</td>
<td align="left" valign="top">BINARY(4)</td>
<td align="left" valign="top">Offset to word</td>
</tr>
<tr>
<td align="center" valign="top">&nbsp;</td>
<td align="center" valign="top">&nbsp;</td>
<td align="left" valign="top">BINARY(4)</td>
<td align="left" valign="top">Length of word</td>
</tr>
<tr>
<td align="center" valign="top">&nbsp;</td>
<td align="center" valign="top">&nbsp;</td>
<td align="left" valign="top">CHAR(1)</td>
<td align="left" valign="top">Misspelled</td>
</tr>
<tr>
<td align="center" valign="top">&nbsp;</td>
<td align="center" valign="top">&nbsp;</td>
<td align="left" valign="top">CHAR(*)</td>
<td align="left" valign="top">Reserved</td>
</tr>
<tr>
<td align="left" valign="top" colspan="4"><strong>Note:</strong> The following field is repeated for each word returned. Each word is located by the offset to word field and the length of the word is specified in the length of word field.</td>
</tr>
<tr>
<td align="center" valign="top">&nbsp;</td>
<td align="center" valign="top">&nbsp;</td>
<td align="left" valign="top">CHAR(*)</td>
<td align="left" valign="top">Word</td>
</tr>
</table>
<br>
<br>
<h3><a name="HDRINDF">Input Dictionaries Format</a></h3>
<p>The following list shows the format of the input dictionaries parameter. For detailed descriptions of the fields, see <a href="#HDRCHK">Field Descriptions</a>.</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%">0</td>
<td align="center" valign="top" width="10%">0</td>
<td align="left" valign="top" width="20%">BINARY(4)</td>
<td align="left" valign="top" width="60%">Offset to dictionary entries</td>
</tr>
<tr>
<td align="center" valign="top">4</td>
<td align="center" valign="top">4</td>
<td align="left" valign="top">BINARY(4)</td>
<td align="left" valign="top">Number of dictionary entries</td>
</tr>
<tr>
<td align="center" valign="top">8</td>
<td align="center" valign="top">8</td>
<td align="left" valign="top">BINARY(4)</td>
<td align="left" valign="top">Reserved (must be set to 0)</td>
</tr>
<tr>
<td align="left" valign="top" colspan="4"><strong>Note:</strong> Format of a dictionary entry. The following fields are repeated by the number of dictionary entries. The decimal and hexadecimal offsets depend on the number of dictionary entries. The first dictionary entry is found by using the offset to dictionary entries in the header section.</td>
</tr>
<tr>
<td align="center" valign="top">&nbsp;</td>
<td align="center" valign="top">&nbsp;</td>
<td align="left" valign="top">CHAR(10)</td>
<td align="left" valign="top">Dictionary name</td>
</tr>
<tr>
<td align="center" valign="top">&nbsp;</td>
<td align="center" valign="top">&nbsp;</td>
<td align="left" valign="top">CHAR(10)</td>
<td align="left" valign="top">Dictionary library name</td>
</tr>
</table>
<br><br>
<h3><a name="HDROUTDF">Output Dictionaries Format</a></h3>
<p>The following shows the format of the output dictionaries parameter. For detailed descriptions of the fields, see <a href="#HDRCHK">Field Descriptions</a>.</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%">0</td>
<td align="center" valign="top" width="10%">0</td>
<td align="left" valign="top" width="20%">BINARY(4)</td>
<td align="left" valign="top" width="60%">Number of dictionaries returned</td>
</tr>
<tr>
<td align="center" valign="top">4</td>
<td align="center" valign="top">4</td>
<td align="left" valign="top">BINARY(4)</td>
<td align="left" valign="top">Number of dictionaries available</td>
</tr>
<tr>
<td align="left" valign="top" colspan="4"><strong>Note:</strong> The following fields are repeated by the number of dictionaries returned. The decimal and hexadecimal offsets depend on the number of dictionaries returned.</td>
</tr>
<tr>
<td align="center" valign="top">&nbsp;</td>
<td align="center" valign="top">&nbsp;</td>
<td align="left" valign="top">CHAR(10)</td>
<td align="left" valign="top">Dictionary name</td>
</tr>
<tr>
<td align="center" valign="top">&nbsp;</td>
<td align="center" valign="top">&nbsp;</td>
<td align="left" valign="top">CHAR(10)</td>
<td align="left" valign="top">Dictionary library name</td>
</tr>
</table>
<br><br>
<h3><a name="HDRCHK">Field Descriptions</a></h3>
<p><strong>Bytes available.</strong> The total length of all data available.</p>
<p><strong>Bytes returned.</strong> The length of the data actually returned. If the receiver variable is not large enough to hold all of the data available, only the data that will fit in the space available is returned and this value will be less that the bytes available.</p>
<p><strong>Dictionary library name.</strong> The library containing the language dictionary. The special values for the library name are *CURLIB and *LIBL.</p>
<p><strong>Dictionary name.</strong> The name of the language dictionary.One special value for the name is *USERID.</p>
<table cellpadding="3">
<!-- cols="10 90" -->
<tr>
<td valign="top"><em>*USERID</em></td>
<td valign="top">The name of the dictionary is the same as the user ID for the current job. A library name must be specified with this value.</td>
</tr>
</table>
<p><strong>Length of word.</strong> The length of the word in bytes.</p>
<p><strong>Length of word information entry.</strong> The length of one item in the word information entry section.</p>
<p><strong>Misspelled.</strong> Indicates if the word is misspelled.</p>
<table cellpadding="3">
<!-- cols="5 95" -->
<tr>
<td valign="top"><em>0</em></td>
<td valign="top">The word is spelled correctly.</td>
</tr>
<tr>
<td valign="top"><em>1</em></td>
<td valign="top">The word is misspelled.</td>
</tr>
</table>
<p><strong>Number of dictionaries available.</strong> The number of dictionaries that were actually used to determine if the word or words in the word list were spelled correctly.</p>
<p><strong>Number of dictionaries returned.</strong> The number of dictionaries actually returned in the output dictionaries parameter. If this number is smaller than the number of dictionaries available, then all of the dictionaries could not fit in the space available.</p>
<p><strong>Number of dictionary entries.</strong> The number of usable dictionaries to perform the function. Valid values are 1 through 8.</p>
<p><strong>Number of words available.</strong> The number of words which are found in the word list.</p>
<p><strong>Number of words returned.</strong> The number of words actually returned in the receiver variable. If this number is smaller than the number of words available, then all of the words could not fit in the receiver variable.</p>
<p><strong>Offset to dictionary entries.</strong> The byte offset, from the beginning of the parameter, to the beginning of the dictionary entries.</p>
<p><strong>Offset to first word information entry.</strong> The byte offset, from the beginning of the receiver variable, to the first item in the word information entry section.</p>
<p><strong>Offset to word.</strong> The byte offset, from the beginning of the receiver variable, to the actual word.</p>
<p><strong>Reserved.</strong> This field must be set to 0 on the input dictionaries parameter. Otherwise, this field is ignored.</p>
<p><strong>Word.</strong> The word that was checked for spelling.</p>
<br>
<h3>Error Messages</h3>
<table width="100%" cellpadding="3">
<!-- cols="15 85" -->
<tr>
<th align="left" valign="top">Message ID</th>
<th align="left" valign="top">Error Message Text</th>
</tr>
<tr>
<td align="left" valign="top">CPF24B4 E</td>
<td valign="top">Severe error while addressing parameter list.</td>
</tr>
<tr>
<td align="left" valign="top">CPF3CF1 E</td>
<td valign="top">Error code parameter not valid.</td>
</tr>
<tr>
<td align="left" valign="top">CPF3CF2 E</td>
<td valign="top">Error(s) occurred during running of &amp;1 API.</td>
</tr>
<tr>
<td align="left" valign="top">CPF3C19 E</td>
<td valign="top">Error occurred with receiver variable specified.</td>
</tr>
<tr>
<td align="left" valign="top">CPF3C21 E</td>
<td valign="top">Format name &amp;1 is not valid.</td>
</tr>
<tr>
<td align="left" valign="top">CPF3C24 E</td>
<td valign="top">Length of the receiver variable is not valid.</td>
</tr>
<tr>
<td align="left" valign="top">CPF3C90 E</td>
<td valign="top">Literal value cannot be changed.</td>
</tr>
<tr>
<td align="left" valign="top">CPF8751 E</td>
<td valign="top">Number of dictionaries is not valid.</td>
</tr>
<tr>
<td align="left" valign="top">CPF8752 E</td>
<td valign="top">No valid dictionaries were found.</td>
</tr>
<tr>
<td align="left" valign="top">CPF8753 E</td>
<td valign="top">Length of word list not valid.</td>
</tr>
<tr>
<td align="left" valign="top">CPF8755 E</td>
<td valign="top">Length of input dictionaries not valid.</td>
</tr>
<tr>
<td align="left" valign="top">CPF8756 E</td>
<td valign="top">Length of output dictionaries not valid.</td>
</tr>
<tr>
<td align="left" 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="off1a.htm">Office APIs</a> | <a href=
"aplist.htm">APIs by category</a></td>
</tr>
</table>
</body>
</html>