VALIDATE_NAME_RETURN_NUM

This procedure checks a coded character set or ccsversion name to determine if it resides in the SYSTEM/CCSFILE file. A coded character set or ccsversion in CCSVSN_TYPE is designated to be checked, and a name is supplied in NAME_ARY. The procedure returns the number of the given character set or ccsversion in NUM.

This procedure might be used to obtain the ccsversion number needed as a parameter in other CENTRALSUPPORT library procedures.

Example

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

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

  REPLACE NAME_ARY[0] BY "CANADAGP";
  RESULT := VALIDATE_NAME_RETURN_NUM(CS_CCSVERSIONV, NAME_ARY, NUM);
  WRITE(OUT,<"RESULT = ",J4>,RESULT);
  IF RESULT EQL CS_DATAOKV THEN
     WRITE(OUT,<"NUM    = ",J4>,NUM);
  CLOSE(OUT,LOCK);
END.

Output

RESULT = 1
NUM    = 75

In this call, the parameters have the following meanings:

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

Value

Value Name

Meaning

0

CS_CHARACTER_SETV

Return a coded character set number.

1

CS_CCSVERSIONV

Return a ccsversion number.

NAME_ARY is an EBCDIC array passed to the procedure. It contains the coded character set or ccsversion name for which a number is being requested. The name can be up to 17 characters long. If this parameter contains zeros or blanks and the first parameter is CS_CCSVERSIONV, the procedure validates the system defined ccsversion. If there is no system default, the procedure returns an error in RESULT.

NUM is an integer returned by the procedure. It contains the specified coded character set or ccsversion number.

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_BAD_ARRAY_DESCRIPTIONV (3000)

CS_FAULTV (1001)

CS_BAD_DATA_LENV (3002)

CS_NO_NAME_FOUNDV (3004)

CS_BAD_TYPE_CODEV (3006)

CS_SOFTERRV (1002)

CS_DATAOKV (1)