CNV_INFO

This procedure returns the definition of the specified convention. The definition can be retrieved from memory or from the *SYSTEM/CONVENTIONS file.

Example

This example retrieves the UnitedKingdom1 convention definition from the *SYSTEM/CONVENTIONS file and returns it in INFO_ARY.

BEGIN

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

  FILE OUT(KIND=DISK,UNITS=CHARACTERS,MYUSE=IO,FILETYPE=0,NEWFILE,
           MAXRECSIZE=80,TITLE="OUT/ALGOL/CNVINFO.");
  DEFINE MAX_NAME_LEN        = 17#;    % Maximum length of convention
                                       % name
  ARRAY LINEOUT[0:14], INFO_ARY[0:62], ALTCURRENCY[0:2],
        LONGDATETMP[0:9];
  EBCDIC ARRAY CNV_NAME[0:MAX_NAME_LEN - 1];
  INTEGER INFO_LEN, RESULT;
  REPLACE CNV_NAME BY "UNITEDKINGDOM1";
  RESULT := CNV_INFO(CS_CNVFILE_INFOV, CNV_NAME, INFO_LEN, INFO_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,<"Max. Integer Digits                   [0]       ",J3>,
              INFO_ARY[0]);
    WRITE(OUT,<"Max. Fractional Digits                [1]       ",J3>,
              INFO_ARY[1]);
    WRITE(OUT,<"Max. International Fractional Digits  [2]       ",J3>,
              INFO_ARY[2]);
    WRITE(OUT,<"International Currency Notation       [3:4]     ",C12>,
              POINTER(INFO_ARY[3]));
    WRITE(OUT,<"Long Date Template                    [5:12]    ",C24>,
              POINTER(INFO_ARY[5]));
    WRITE(OUT,<"Short Date Template                   [13:20]   ",C24>,
              POINTER(INFO_ARY[13]));
    WRITE(OUT,<"Numeric Date Template                 [21:24]   ",C24>,
              POINTER(INFO_ARY[21]));
    WRITE(OUT,<"Long Time Template                    [25:32]   ",C24>,
              POINTER(INFO_ARY[25]));
    WRITE(OUT,<"Numeric Time Template                 [33:36]   ",C24>,
              POINTER(INFO_ARY[33]));
    WRITE(OUT,<"Monetary Template                     [37:44]   ",C24>,
              POINTER(INFO_ARY[37]));
    WRITE(OUT,<"Numeric Template                      [45:52]   ",C24>,
              POINTER(INFO_ARY[45]));
    WRITE(OUT,<"Reserved                              [53:60]   ",C24>,
              POINTER(INFO_ARY[53]));
    WRITE(OUT,<"Lines per Page                        [61]      ",J3>,
              INFO_ARY[61]);
    WRITE(OUT,<"Characters per Line                   [62]      ",J3>,
              INFO_ARY[62]);
  END;
  CLOSE(OUT,LOCK);
END.

Output

RESULT = 1

Field Meaning                           Location  Value
-------------                           --------  -----
Max. Integer Digits                     [0]       12
Max. Fractional Digits                  [1]       2
Max. International Fractional Digits    [2]       2
International Currency Notation         [3:4]     "$ "
Long Date Template                      [5:12]  !W!,!DE!!N!,!YYYY!
Short Date Template                     [13:20] !D!!1N!!0Y!
Numeric Date Template                   [21:24] !D!.!0O!.!0Y!
Long Time Template                      [25:32] !H!:!0M!:!0S!.!PP!!A!
Numeric Time Template                   [33:36] !H!:!OM!
Monetary Template                       [37:44] !C[$]T[,:0,3]D[.]#N[-]!
Numeric Template                        [45:52] !T[,:0,3]D[.]#N[-]!
Reserved                                [53:60]
Lines per Page                          [61]      70
Characters per Line                     [62]      82

In this call, the parameters have the following meanings:

CS_CNVFILE_INFOV represents an integer that requests that convention information be retrieved from the file in use, *SYSTEM/CONVENTIONS. This integer is one of two options:

Value

Value Name

Type of Information Returned

0

CS_CNVMEM_INFOV

Convention information is retrieved from the memory (current working set).

1

CS_CNVFILE_INFOV

Convention information is retrieved from the file in use (*SYSTEM/CONVENTIONS).

Two copies of convention information reside on the system. One copy is in memory and is stored in the CENTRALSUPPORT library during initialization. The other copy is on disk and is stored in the *SYSTEM/CONVENTIONS file.

CNV_NAME is an EBCDIC array that contains the name of the convention set for which a definition is requested. If this parameter contains all blanks or zeros, the procedure uses the hierarchy to determine the convention to be used. Refer to the MultiLingual System Administration, Operations, and Programming Guide for the list of convention names and the explanation of the hierarchy.

INFO_LEN is an integer that contains the number of characters in INFO_ARY.

INFO_ARY is a real array passed to the procedure. It contains the convention definition to be added to conventions in memory and to the *SYSTEM/CONVENTIONS file in use. For the procedure to work, all fields in INFO_ARY must contain data, or an appropriate error result is returned. Data in INFO_ARY is passed in fields as follows:

Field Meaning

Word

Maximum integer digits

0

Maximum decimal digits

1

Maximum international decimal digits

2

International currency notation

3

Long date template

5

Short date template

13

Numeric date template

21

Long time template

25

Numeric time template

33

Monetary template

37

Numeric template

45

Lines per page

61

Characters per line

62

The international currency notation field contains the international currency notation defined for the convention. The international currency notation is surrounded by a pair of matching delimiters that are not part of the symbol. Any blanks inside the delimiters are significant and are treated as any other character. For example, the international currency notation for the ASERIESNATIVE convention is "USD "; the trailing blank is significant and the quotation marks are delimiters.

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_DATA_LENV (3002)

CS_INCOMPLETE_DATAV (2004)

CS_CONVENTION_NOT_FOUNDV (2002)

CS_SOFTERRV (1002)