VALIDATE_NUM_RETURN_NAME

This procedure checks the number of the coded character set or ccsversion to determine if it resides in the SYSTEM/CCSFILE file. A coded character set or ccsversion is designated to be checked and a number in NUM is supplied. The procedure returns the name of the given coded character set or ccsversion number. Refer to the MultiLingual System Administration, Operations, and Programming Guide for the list of numbers for coded character sets and ccsversions.

This procedure might be used to display to the application user the name of the coded character set or the ccsversion being used.

Example

This example checks to see if a ccsversion number 75 is valid. Assume for this example that 75 is valid and its associated name is CanadaGP.

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/VAL_NUM_RET_NAME.");
  EBCDIC ARRAY NAME_ARY[0:17];
  INTEGER NUM
        ,RESULT;

  NUM := 75;
  RESULT := VALIDATE_NUM_RETURN_NAME(CS_CCSVERSIONV, NUM, NAME_ARY);
  WRITE(OUT,<"RESULT = ",J4>,RESULT);
  IF RESULT EQL CS_DATAOKV THEN
     WRITE(OUT,<"NAME   = ",A18>,NAME_ARY);
  CLOSE(OUT,LOCK);
END.

Output

RESULT = 1
NAME   = CANADAGP

In this call, the parameters have the following meanings:

CS_CCSVERSIONV represents an integer that requests the ccsversion number be returned. It is one of two options:

Value

Value Name

Meaning

0

CS_CHARACTER_SETV

Return a coded character set name.

1

CS_CCSVERSIONV

Return a ccsversion name.

NUM is an integer passed to the procedure. It contains the number for the coded character set or ccsversion for which the name is being requested. The value –2 indicates that the system default ccsversion is being validated.

Refer to the MultiLingual System Administration, Operations, and Programming Guide for more information about the hierarchy.

NAME_ARY is an EBCDIC array returned by the procedure. It contains the coded character set or ccsversion name. The maximum length of the name is 17 characters.

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_NO_NUM_FOUNDV (3003)

CS_BAD_TYPE_CODEV (3006)

CS_SOFTERRV (1002)

CS_DATAOKV (1)