This procedure returns a truth set for the designated ccsversion. The truth set contains the characters in a given data class for the ccsversion. Truth sets are available for the following data classes:
-
Alphabetic
-
Numeric
-
Space
-
Presentation (The characters that can be displayed or printed on a presentation device)
The truth set from VSNTRUTHSET can be retained in working memory. This truth set can then be used with the SCAN statement. This improves performance over a call to VSNINSPECT_TEXT. Because the table is stored in working memory, it does not have to be retrieved each time it is to be used. This process can improve performance of an application program that performs a high volume of translations.
Example
This example gets the numeric data class truth set for the CanadaEBCDIC ccsversion. The truth set is returned in the TSET_ARY. The MultiLingual System Administration, Operations, and Programming Guide can be used to determine that the ccsversion number for CanadaEBCDIC is 74. This number can also be retrieved by calling VALIDATE_NAME_RETURN_NUM with the name CanadaEBCDIC.
BEGIN
$ INCLUDE INTL="SYMBOL/INTL/ALGOL/PROPERTIES." 10000000 - 49999999
FILE OUT(KIND=DISK,UNITS=CHARACTERS,FILEUSE=IO,FILETYPE=0,NEWFILE,
MAXRECSIZE=80,TITLE="OUT/ALGOL/VSNTRUTH_SET.");
ARRAY TSET_ARY[0:7];
INTEGER VSN_NUM
,RESULT;
VSN_NUM := 74;
RESULT := VSNTRUTHSET(VSN_NUM, CS_NUMERICSV, TSET_ARY);
WRITE(OUT,<"RESULT = ",J4>, RESULT);
CLOSE(OUT,LOCK);
END.Output
RESULT = 1
In this call, the parameters have the following meanings:
VSN_NUM is an integer passed to the procedure. It contains the number of the ccsversion from which the truth set is to be retrieved. The ccsversion contains the rules for translation of text. Refer to the MultiLingual System Administration, Operations, and Programming Guide for a list of ccsversion numbers. The values allowed for VSN_NUM and the meanings of the values are as follows:
|
Value |
Meaning |
|
Greater than or equal to 0 |
Use the specified ccsversion number. |
|
–2 |
Use the system default ccsversion. If the system default ccsversion is not available, an error is returned. |
CS_NUMERICSV represents an integer that indicates the type of truth set to be returned. It is one of six options:
|
Parameter Value |
Value Name |
Truth Set Returned |
|
12 |
CS_ALPHAV |
Alphabetic characters |
|
13 |
CS_NUMERICSV |
Numeric characters |
|
14 |
CS_DISPLAYV |
Displayable characters |
|
15 |
CS_SPACESV |
Space characters |
|
16 |
CS_LOWERCASEV |
Lowercase characters |
|
17 |
CS_UPPERCASEV |
Uppercase characters |
A ccsversion is not required to have a definition for each of these truth sets. Some of the truth sets are optional. Options 16 and 17 are not required. A result of CS_DATA_NOT_FOUNDV (4002) might be returned if the truth set has not been defined for the ccsversion.
TSET_ARY is an array returned from the procedure. It contains the truth set table. It is recommended that the size of this array be 8 words.
RESULT is an integer returned by the procedure. It indicates whether or not an error occurred during the execution of the procedure. An explanation of the error result values and messages can be found at the end of this section. The values returned by this procedure include:
|
CS_ARRAY_TOO_SMALLV (3001) |
CS_FAULTV (1001) |
|
CS_BAD_ARRAY_DESCRIPTIONV (3000) |
CS_FILE_ACCESS_ERRORV (1000) |
|
CS_BAD_TYPE_CODEV (3006) |
CS_NO_NUM_FOUNDV (3003) |
|
CS_DATA_NOT_FOUNDV (4002) |
CS_SOFTERRV (1002) |
|
CS_DATAOKV (1) |

