These utilities are an integral part of the GT.M functionality that permits you to customize your applications for use with other languages. For a description of these utilities, refer to Chapter 12: “Internationalization”.
The internationalization utilities are:
The %GBLDEF utility manipulates the collation sequence assigned to a global other than the default M collation that is based on code value (ASCII for the codes 0 to 127) ordering except for numeric values, which order most negative to most positive before string values. As described in the Internationalization Chapter, alternative collation definition requires supplying routines that transform codes into desired collation order. All subscripted variables for a global must use the same collation sequence. A global collation sequence can only be changed when a global has no subscripted variables defined.
get^%GBLDEF(gname[,reg])
get: returns a value associated with the current global variable collation in the form nct,act,ver, where:
A "0" return from $$get^%GBLDEF(gname[,reg]) indicates that the global has no special characteristics and uses the region default collation, while a "0,0,0" return indicates that the global is explicitly defined to M collation.
kill^%GBLDEF(gname)
kill: returns a TRUE (1) if the current global variable collation now uses M standard collation that is based on code value (ASCII for the codes 0 to 127) ordering except for numeric values, which order most negative to most positive before string values;It returns FALSE (0) if:
set^%GBLDEF(gname[,nct][,act])
set: if possible, esablishes a global variable collation; returns a TRUE (1) if the current successful in establishing or matching global variable collation characteristics;returns FALSE (0) if:
Of the following input arguments only the second and third are valid for set, while the first is required for all three functions:
For more information and usage examples, refer to “Using the %GBLDEF Utility” in the Internationalization Chapter of this manual.
The %LCLCOL utility deals with the adoption and reporting of a local variable collation other than the default M collation that is based on code value (ASCII for the codes 0 to 127) ordering except for numeric values, which order most negative to most positive before string values. As described in the Internationalization Chapter, alternative collation definition requires supplying routines that transform codes into desired collation order. All subscripted local variables for a process must use the same collation sequence. The collation sequence used by local variables can be established as a default or by this utility within the current process. The local collation sequence can only be changed when a process has no subscripted local variables defined.
To establish a default local collation sequence prior to invoking a GT.M process, provide a numeric value to the environment variable gtm_local_collate to select one of the collation tables.
get^%LCLCOL[()]
get: returns an integer value associated with the current local variable collation.
getncol^%LCLCOL[()]
getncol: returns a FALSE (0) if the current local variable collation uses the original GT.M collation of an empty string ("NULL) value between numeric values and strings, and a TRUE (1) value indicates the proces is using the M standard collation where the empty string collates before all other values.
getnct^%LCLCOL[()]
getnct: returns a FALSE (0) if the current local variable collation follows the M standard of collating numeric values before all non-empty strings and a TRUE (1) if it uses only code order with no special treatment of numeric values.
set^%LCLCOL([colid][,ncol][,nct])
set: if possible, esablishes a local variable collation.
If the set invocation supplies no argument, there is no environment variable defined corresponding to the first argument, or the specification requests a change when subscripted local variables already exist, the extrinsic function returns a FALSE (0). If the function successly modifies the local variable collation, or the specification matches the current settings, the function returns a TRUE (1).
The following input arguments are valid only for set:
For more information and usage examples, refer to “Establishing A Local Collation Sequence”in the Internationalization Chapter of this manual.
The %PATCODE utility is a wrapper for pattern code related VIEW "PATCODE":code" and $VIEW("PATCODE"), and has the following extrinsic entry points:
get^%PATCODE[()]
get: returns the name of the process current pattern table; for example the default table is "M"
set^%PATCODE(tablename)
set: updates the current process pattern table to the named table
If the set invocation finds the character set is UTF-8, it returns FALSE (0) if the argument is missing or does not correspond to an existing file, the function returns the empty string; it successfuly changes the pattern table or matches the current table, the function returns TRUE (1).