CCSVSN_NAMES_NUMS

This procedure returns a list of coded character set names and numbers or a list of ccsversion names and numbers that are available on the system. The user can specify the type of list as either a ccsversion or a coded character set. The names and numbers are listed in two arrays. These arrays are ordered so that the names in the names array correspond to the numbers in the numbers array.

This procedure might be used to create a menu that lists the ccsversions on the host computer from which a user can choose. It might also be used to verify that the ccsversion to be used by a program is available on the host computer.

Example

This example returns a list of available ccsversion names and numbers on a system. This is an arbitrary list of three ccsversions and might not be the same on every system.

BEGIN

 $ INCLUDE INTL="SYMBOL/INTL/ALGOL/PROPERTIES." 10000000 - 49999999

  DEFINE MAX_NAME_LEN = 17 #;

  FILE OUT(KIND=DISK,UNITS=CHARACTERS,FILEUSE=IO,FILETYPE=0,NEWFILE,
           MAXRECSIZE=80,TITLE="OUT/ALGOL/CCSVSNNAMESNUMS.");
  EBCDIC ARRAY NAMES_ARY[0:(20*MAX_NAME_LEN) - 1]; %holds 20 names
  INTEGER ARRAY NUMS_ARY[0:19];                     %holds 20 numbers
  ARRAY LINEOUT[0:14];
  INTEGER TOTAL
        ,I
        ,RESULT;

  RESULT := CCSVSN_NAMES_NUMS(CS_CCSVERSIONV, TOTAL, NAMES_ARY,
            NUMS_ARY);
  WRITE(OUT,<"RESULT = ",J4>,RESULT);
  IF RESULT EQL CS_DATAOKV THEN
  

BEGIN
    REPLACE LINEOUT BY " " FOR 80;
    WRITE(OUT, 80, LINEOUT);
    WRITE(OUT, <"CCSVERSION NAME", T24,"CCSVERSION NUMBER">);
    WRITE(OUT, <"---------------", T24,"-----------------">);
    FOR I:= 0 STEP 1 UNTIL TOTAL-1 DO
       WRITE(OUT, <A17,T24,X8,J4>, NAMES_ARY[I*17], NUMS_ARY[I]);
    END;
  CLOSE(OUT,LOCK);
END.

Output

RESULT = 1
CCSVERSION NAME        CCSVERSION NUMBER
---------------        -----------------
ASERIESNATIVE                  0
SWISS                          64
SWEDISH1                       99

In this call, the parameters have the following meanings:

CS_CCSVERSIONV represents an integer that requests the names and numbers of the ccsversions. This is one of two types of information that can be returned in the output parameters:

Value

Value Name

Meaning

0

CS_CHARACTER_SETV

Return the names and numbers of the coded character sets

1

CS_CCSVERSIONV

Return the names and numbers of the ccsversions

TOTAL is an integer returned by the procedure that contains the number of coded character set or ccsversion entries that exist.

NAMES_ARY is an EBCDIC array returned by the procedure. Each entry contains the name of a coded character set or ccsversion defined in the SYSTEM/CCSFILE. Each name takes 17 EBCDIC characters. The size of NAMES_ARY should be 17 times the number of convention names you might have on the system. The MultiLingual System Administration, Operations, and Programming Guide names all the coded character sets and ccsversions.

NUMS_ARY is an array of integers returned by the procedure that contains the coded character set or ccsversion numbers. NUMS_ARY contains all the coded character set or ccsversion numbers defined in file SYSTEM/CCSFILE. Each element in NUMS_ARY corresponds to an element in NAMES_ARY. Each number uses one element of NUMS_ARY. The MultiLingual System Administration, Operations, and Programming Guide gives all the numbers for the coded character sets and ccsversions.

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_DATAOKV (1)

CS_BAD_ARRAY_DESCRIPTIONV (3000)

CS_FAULTV (1001)

CS_BAD_TYPE_CODEV (3006)

CS_SOFTERRV (1002)