CNV_MODIFY

This procedure modifies an existing convention in the *SYSTEM/CONVENTIONS file. The modified set becomes effective after the next halt/load.

Note that this procedure can be used to modify only conventions that have been created by a user. The conventions provided to you cannot be modified.

Example

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/CNVMODIFY.");
  DEFINE MAX_NAME_LEN        = 17#;    % Maximum length of convention
                                       % name
  DEFINE
     SHORTDATETEMP           =  5#,    % MODMASK bit position
     MONETARYTEMP            =  9#;    % MODMASK bit position
  ARRAY MOD_ARY[0:62];
  EBCDIC ARRAY CNV_NAME[0:MAX_NAME_LEN - 1];
  INTEGER RESULT;
  REAL MODMASK;

  REPLACE CNV_NAME BY "UTOPIA";
  MODMASK := 0 & 1 [SHORTDATETEMP:1] % set bits to show what fields
               & 1 [MONETARYTEMP:1]; % contain data in MOD_ARY
  REPLACE POINTER(MOD_ARY[13]) BY "!1W!,!1N!!DE!,!YYYY!";
  REPLACE POINTER(MOD_ARY[37]) BY "!N[-]C[UTA]T[.:0,3]D[,]#!";
  RESULT := CNV_MODIFY(CNV_NAME, MODMASK, MOD_ARY);
  WRITE(OUT,<"RESULT = ",J4>,RESULT);
  CLOSE(OUT,LOCK);
END.

This example modifies the short date and monetary templates in a convention named Utopia.

Output

RESULT = 1

In this call, the parameters have the following meanings:

CNV_NAME is an EBCDIC array that is passed to the procedure. It contains the name of the convention to be modified. 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.

MODMASK is a real number that is passed to the procedure. It provides a mask that indicates the fields to be modified in the specified convention.

Any or all bits in positions 0 through 12 can be set to indicate which fields should be modified. Each bit is associated with a unique field in MOD_ARY. If the bit is equal to 1, then the data in the corresponding field in MOD_ARY is validated and stored in the designated convention. Bit 0 in MODMASK corresponds to the first field in MOD_ARY, bit 1 to field 2, and so on.

MOD_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 MOD_ARY must contain data, or an appropriate error result is returned. Data in MOD_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_NTIMETEMPV (3022)

CS_BAD_ARRAY_DESCRIPTIONV (3000)

CS_BAD_NUMTEMPV (3024)

CS_BAD_CPLV (3028)

CS_BAD_SDATETEMPV (3019)

CS_BAD_DATA_LENV (3002)

CS_CNVFILE_NOTPRESENTV (3037)

CS_BAD_FRACDIGITSV (3016)

CS_CNV_NOTAVAILV (3036)

CS_BAD_LDATETEMPV (3018)

CS_CONVENTION_NOT_FOUNDV (2002)

CS_BAD_LPPV (3027)

CS_DATAOKV (1)

CS_BAD_LTIMETEMPV (3021)

CS_DEL_PERMANENT_CNV_ERRV (3040)

CS_BAD_MAXDIGITSV (3015)

CS_FAULTV (1001)

CS_BAD_MONTEMPV (3023)

CS_FILE_ACCESS_ERRORV (1000)

CS_BAD_NDATETEMPV (3020)

CS_SOFTERRV (1002)