VSNORDERING_INFO

This procedure returns the ordering information for a designated ccsversion. The ordering information determines the way in which data is collated for the ccsversion. It includes the ordering and priority sequence values of the characters and any substitution of characters to be made when the designated ccsversion ordering is applied to a string of text.

The table obtained with this procedure might be used with the COMPARE_TEXT_USING_ORDER_INFO procedure. Because the table is stored in working memory, it does not have to be retrieved each time it is used. Using this combination of procedures in place of a general call to the VSNCOMPARE_TEXT procedure can improve the performance of an application program that performs a high volume of translations.

Example

This example gets the ordering information for the CanadaEBCDIC ccsversion. The ordering information is returned in ORDER_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/VSNORDERING_INFO.");
  ARRAY ORDER_ARY[0:255];
  INTEGER VSN_NUM
        ,RESULT;

  VSN_NUM := 74;
  RESULT := VSNORDERING_INFO(VSN_NUM, ORDER_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 for which ordering information is requested.

ORDER_ARY is an array returned from the procedure. It contains the ordering information for the ccsversion. The first two words of the array are size words. Word 1 is not used at this time. Word 0 contains the following information:

Word

Offset

Information Contained

Word 0

[47:08]

Size of ordering ttable in words (always 64)

Word 0

[39:08]

Size of priority ttable in words (always 64)

Word 0

[31:08]

Size of substitution characters truth set in words (may be greater than or equal to 0 words)

Word 0

[23:08]

Size of substitution sequences array in words (may be greater than or equal to 0 words)

Word 0

[15:08]

Size of substitution ordering array in words (may be greater than or equal to 0 words)

Word 0

[07:08]

Size of substitution priority array in words (may be greater than or equal to 0 words)

ORDER_ARY also contains the following components in order:

  1. Ordering translate table

    64-word ALGOL translate table. Translates each character to its ordering sequence value.

  2. Priority translate table

    64-word ALGOL translate table. Translates each character to its priority sequence value.

  3. Substitution characters truth set

    An ALGOL truth set that contains all the characters that are part of any substitution sequence, many to one or one to many.

  4. Substitution sequences array

    A real array. Each word contains one of the substitution sequences, right justified. For example, if ch is a substitution sequence, then it is stored as 0000008388.

  5. Substitution ordering array

    A real array, parallel to substitution sequences array. For each substitution sequence, the ordering sequence values for that sequence are stored in the corresponding word along with the length (left-justified). The format of the word is [47:08] number of ordering sequence values. This must be greater than or equal to 1, or less than or equal to 3. The next [47:08] bytes contain the OSVs left-justified. For example, suppose a with e is substituted by the OSVs 129 and 133. The substitution ordering word will appear as 028185000000. The elements of the substitution ordering word have the following meanings:

    02

    Two OSVs

    81

    The OSV 129

    85

    The OSV 133

  6. Substitution priority array

    A real array. Each word contains the priority sequence values corresponding to the substitution ordering array. The word format of this array is exactly the same as the word format of the substitution ordering array.

    It is recommended that the size of this array be 256 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_FILE_ACCESS_ERRORV (1000)

CS_BAD_ARRAY_DESCRIPTIONV (3000)

CS_NO_NUM_FOUNDV (3003)

CS_DATAOKV (1)

CS_SOFTERRV (1002)

CS_FAULTV (1001)