Check Spelling (QTWCHKSP) API


  Required Parameter Group:


  Default Public Authority: *USE

  Threadsafe: No

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 Aid Spelling (QTWAIDSP) API.

The QTWCHKSP API can be used to do the following:

To perform the function, a user can specify a maximum of eight IBM® or user language dictionaries in the input dictionaries parameter.


Authorities and Locks

Dictionary Authority
*USE
Dictionary Library Authority
*USE
Dictionary Lock Authority
*SHRNUP

Required Parameter Group

Receiver variable
OUTPUT; CHAR(*)

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.

Length of receiver variable
INPUT; BINARY(4)

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.

Format name
INPUT; CHAR(8)

The content and format of the information returned in the receiver variable. For more information about the format, see CHKW0100 and CHKW0200 Formats. The following are possible format names:


Word list
INPUT; CHAR(*)

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. See the i5/OS globalization topic collection for more information about CCSIDs. See Word Separator Tables for information about word separators.

Length of word list
INPUT; BINARY(4)

The length of the word list in bytes.

Input dictionaries
INPUT; CHAR(*)

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 Input Dictionaries Format.

Length of input dictionaries
INPUT; BINARY(4)

The length of the input dictionaries parameter. The only valid value is 172 bytes.

Output dictionaries
OUTPUT; CHAR(*)

A structure containing a list of up to eight dictionaries that were actually used. For the format of this parameter, see Output Dictionaries Format.

Length of output dictionaries
INPUT; BINARY(4)

The length of the output dictionaries parameter. The following are valid values:


Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.


CHKW0100 and CHKW0200 Formats

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.

The receiver variable has three logical sections which contain:

For more detailed descriptions of the fields in the table, see Field Descriptions.



Input Dictionaries Format

The following list shows the format of the input dictionaries parameter. For detailed descriptions of the fields, see Field Descriptions.



Output Dictionaries Format

The following shows the format of the output dictionaries parameter. For detailed descriptions of the fields, see Field Descriptions.



Field Descriptions

Bytes available. The total length of all data available.

Bytes returned. 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.

Dictionary library name. The library containing the language dictionary. The special values for the library name are *CURLIB and *LIBL.

Dictionary name. The name of the language dictionary.One special value for the name is *USERID.

Length of word. The length of the word in bytes.

Length of word information entry. The length of one item in the word information entry section.

Misspelled. Indicates if the word is misspelled.

Number of dictionaries available. The number of dictionaries that were actually used to determine if the word or words in the word list were spelled correctly.

Number of dictionaries returned. 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.

Number of dictionary entries. The number of usable dictionaries to perform the function. Valid values are 1 through 8.

Number of words available. The number of words which are found in the word list.

Number of words returned. 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.

Offset to dictionary entries. The byte offset, from the beginning of the parameter, to the beginning of the dictionary entries.

Offset to first word information entry. The byte offset, from the beginning of the receiver variable, to the first item in the word information entry section.

Offset to word. The byte offset, from the beginning of the receiver variable, to the actual word.

Reserved. This field must be set to 0 on the input dictionaries parameter. Otherwise, this field is ignored.

Word. The word that was checked for spelling.


Error Messages



API introduced: V2R3

[ Back to top | Office APIs | APIs by category ]