CNV_ADD

CNV_ADD adds a new convention to the *SYSTEM/CONVENTIONS file. The new definition is available immediately.

Example

This example adds a new convention definition named Utopia to the SYSTEM/CONVENTIONS file.

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/CNVADD.");
  DEFINE MAX_NAME_LEN        = 17#;    % Maximum length of convention
                                       % name
  ARRAY ADD_ARY[0:62];
  EBCDIC ARRAY CNV_NAME[0:MAX_NAME_LEN - 1];
  INTEGER RESULT;
   REPLACE CNV_NAME BY "UTOPIA";
  ADD_ARY[0] := 12;                    % Maximum digits
  ADD_ARY[1] := 2;                     % # of fractional digits
  ADD_ARY[2] := 2;                     % # of international frac digits
  REPLACE POINTER(ADD_ARY[3]) BY "!UTA!";
  REPLACE POINTER(ADD_ARY[5]) BY "!W!,!N!!D!,!Y!";
  REPLACE POINTER(ADD_ARY[13]) BY "!1W!,!1N!!D!,!Y!";
  REPLACE POINTER(ADD_ARY[21]) BY "!0O!/!0D!/!Y!";
  REPLACE POINTER(ADD_ARY[25]) BY "!0T!:!0M!:!0S!.!PPPP!";
  REPLACE POINTER(ADD_ARY[33]) BY "!0T!:!0M!:!0S!";
  REPLACE POINTER(ADD_ARY[37]) BY "!C[$]N[-]T[,:0,3]D[.]#!";
  REPLACE POINTER(ADD_ARY[45]) BY "!N[-]T[,:0,3]D[.]#!";
  ADD_ARY[61] := 66;
  ADD_ARY[62] := 132;
  RESULT :=CNV_ADD(CNV_NAME, ADD_ARY);
  WRITE(OUT,<"RESULT = ",J4>,RESULT);
  CLOSE(OUT,LOCK);
END.

Output

RESULT = 1

In this call, the parameters have the following meanings:

CNV_NAME is an EBCDIC array passed to the procedure. It contains the name of the convention to be added to the conventions file. 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 an explanation of the hierarchy.

ADD_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 ADD_ARY must contain data, or an appropriate error result is returned. Data in ADD_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 notation. 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_BAD_ALT_FRAC_DIGITSV (3017)

CS_BAD_NDATETEMPV (3020)

CS_BAD_ARRAY_DESCRIPTIONV (3000)

CS_BAD_NTIMETEMPV (3022)

CS_BAD_CPLV (3028)

CS_BAD_NUMTEMPV (3024)

CS_BAD_DATA_LENV (3002)

CS_BAD_SDATETEMPV (3019)

CS_BAD_FRACDIGITSV (3016)

CS_CNV_EXISTS_ERRV (3014)

CS_BAD_LDATETEMPV (3018)

CS_CNVFILE_NOTPRESENTV (3037)

CS_BAD_LPPV (3027)

CS_CONVENTION_NOT_FOUNDV (2002)

CS_BAD_LTIMETEMPV (3021)

CS_DATAOKV (1)

CS_BAD_LPPV (3027)

CS_FAULTV (1001)

CS_BAD_MAXDIGITSV (3015)

CS_FILE_ACCESS_ERRORV (1000)

CS_BAD_MONTEMPV (3023)

CS_SOFTERRV (1002)