This procedure provides basic information about a designated coded character set, including the number of bits per character (8, 16, or mixed) and the coding format (for example, ISO or EBCDIC).
This procedure can be used to determine the code format for a file that has its INTMODE set to a character set name. See the MultiLingual System Administration, Operations, and Programming Guide for a list of coded character sets available.
Example
This example calls the procedure CCSINFO to get information about the Latin1EBCDIC coded character set. The MultiLingual System Administration, Operations, and Programming Guide contains the information that the coded character set number for Latin1EBCDIC is 12. This number can also be retrieved by calling VALIDATE_NAME_RETURN_NUM with the name Latin1EBCDIC.
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/CCSINFO.");
ARRAY CCS_ARY[0:4]
,LINEOUT[0:14];
INTEGER CCS_NUM
,RESULT;
CCS_NUM := 12; % Latin1EBCDIC CCS
RESULT := CCSINFO(CCS_NUM, CCS_ARY);
WRITE(OUT,<"RESULT = ",J4>,RESULT);
IF RESULT EQL CS_DATAOKV THEN
BEGIN
REPLACE LINEOUT BY " " FOR 80;
WRITE(OUT,80,LINEOUT);
WRITE(OUT,<"Field Meaning Location Value">);
WRITE(OUT,<"------------- -------- -----">);
WRITE(OUT,<"# of bytes per character [0] ",J3>,
CCS_ARY[0]);
WRITE(OUT,<"Repertoire Number [1] ",J3>,
CCS_ARY[1]);
WRITE(OUT,<"Encoding Number [2] ",J3>,
CCS_ARY[2]);
WRITE(OUT,<"Coding Format [3] ",J3>,
CCS_ARY[3]);
WRITE(OUT,<"Space Character (hexadecimal) [4] ",H12>,
CCS_ARY[4]);
END;
CLOSE(OUT,LOCK);
END.Output
RESULT = 1 Field Meaning Location Value ------------- -------- ----- # of bytes per character [0] 1 Repertoire number [1] 26 Encoding number [2] 1 Coding format [3] 3 Space character (hexadecimal) [4] 404040404040
In this call, the parameters have the following meanings:
CCS_NUM is an integer passed to the procedure. This integer contains the number of the coded character set about which information is requested. The coded character set number is the same as the INTMODE or EXTMODE attribute value of a file.
CCS_ARY is a real array returned by the procedure. This real array contains information about a coded character set from the character set and ccsversion file. The layout for return information in CCS_ARY is as follows:
Word[0] Number of bytes per character, (if the value is 3, the character
set is mixed multibyte with both single and double-byte characters)
Word[1] Repertoire number (not used by new coded character sets)
Word[2] Encoding number (not used by new coded character sets)
Word[3] Code format
% 1 = ISO
% 2 = ASERIESEBCDIC
% 3 = STDEBCDIC
% 4 = BTOS
% 5 = PC
% 6 = EBCDICMB
% 7 = ISOMB
% 8 = PCMB
% 9 = EUCMB
% 10 = 2200MB
% 13 = DOUBLEBYTE
% 14 = UCSBMP
% 15 = UCSBMPNT
Word[4] A full word of space characters
% If the Ccs is 8-bit, the space character is 8-bit.
% If the Ccs is 16-bit, the space character is 16-bit.
% If the Ccs is mixed, the space character is
% 8-bit and the SubCcs records also identify
% their 8-bit or 16-bit space characters.
Word[5]+ When there are extension facilities
(Code format is ISO (word[3] = 1))
Word[5].[47:08] Extension facilities
% 0 = NONE
% 1 = UNISYS01
% 255 = non-UNISYS01
For extension facilities is NONE (word[5].[47:08] = 0)
Word[5].[39:40] Not used
When extension facilities are NONE, the entire word 5
is empty as are any subsequent words in the output array.
For UNISYS01 extension facilities (word[5].[47:08] = 1)
Word[5].[39:01] Defined G1 set
% 0 = undefined G1 set
% 1 = defined G1 set
If defined G1 set (word[5].[39:01] = 1)
Word[5].[38:09] Number of characters in G1 set (94 or 96)
Word[5].[29:01] Registration
% 0 = unregistered
% 1 = registered
If registered (word[5].[29:01] = 1)
Word[5].[28:13] Not used
Word[5].[15:16] Number of escape sequence characters
% characters in the escape
% sequence start at word 6
For non-UNISYS01 extension facilities (word[5].[47:08] = 255)
Word[5].[39:24] Not used
Word[5].[15:16] Number of escape sequence characters
% characters in the escape
% sequence start at word 6
Word[5]+ When there are SubCcs records
(Number of bytes per character is mixed (word[0] = 3))
Word[5] Number of SubCcs records
% each SubCcs record is 4 words long
Word[6] SubCcs library number
Word[7] SubCcs bytes per character
Word[8] SubCcs invocation
% 0 = NONE
% 1 = SS2 (single shift 2)
% 2 = SS3 (single shift 3)
% 3 = ESB (EBCDIC single bracket)
% 4 = ASB (ASCII single bracket)
% 5 = LS (lock shift)
Word[9] SubCcs space character (a full word)
The contents of words 6-9 are repeated starting at
word[10] for every SubCcs which is a part of this
coded character set. That is, word[5] is followed by
by four words of information for every SubCcs record.
The number of SubCcs records is specified in word[5].The recommended array size for CcsInfo is 5 words unless there are escape sequences or SubCcs records, in which case the recommended size is 30 words.
-
Extension facilities are the escape sequences in an ISO environment that are used to specify the code sets (such as C0, C1, G0, G1) from which ISO builds coded character sets. The escape sequences are defined in ISO standard 2022, titled Information Processing–ISO 7-Bit and 8-Bit Coded Character Sets – Code-extension Techniques.
-
A mixed multibyte coded character set requires at least one 8-bit CCS, at least one 16-bit CCS, and a set of subCCS records to define the characteristics of each CCS.
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) |

