To assign a collation sequence to an individual global use the following extrinsic entry point:
set^%GBLDEF(gname,nct,act)
where
The first argument, gname, is the name of the global. If the global name appears as a literal, it must be enclosed in quotation marks (" "). The leading caret symbol (^) must be included, and the name must be a legal M variable name.
The second argument, nct, is an integer that determines how numeric subscripts are to be handled. The value is FALSE (0) if numeric subscripts are to collate before strings, as in standard M, and TRUE (1) if numeric subscripts are to be handled like strings.
The third argument, act, is an integer specifying the active collation sequence–from 0, standard M collation, to 255.
If the global contains data, this function returns a FALSE (0) and does not modify the global.
Example:
GTM> KILL ^G GTM> W $SELECT($$set^%GBLDEF("^G",0,3):"OK",1:"FAILED" OK
This deletes the global variable ^G, then uses the $$set%GBLDEF as an extrinsic to set ^G to the collation sequence number 3 with numeric subscripts collating before strings. Using $$set%GBLDEF as an argument to $SELECT results in a return message notifying whether or not the SET was successful. $SELECT will return a "FAILED" message if the collation sequence requested is undefined.