Returns information about an environmental factor selected by the arguments. In GT.M, the first argument contains a keyword identifying the environmental factor and, where appropriate, subsequent arguments select among multiple possible occurrences of that factor.

The format for the $VIEW() function is:


Argument Keywords of $VIEW()

$VIEW() provides a means to access GT.M environmental information. When GT.M permits modification of the factors accessible with $VIEW(), the VIEW command generally provides the means for effecting the change.

$VIEW() Argument Keywords






In UTF-8 mode processes, enables or disable the generation of an error when character-oriented functions encounter malformed byte sequences (illegal characters). The default is 1.



Value of the break message mask; GT.M defaults this to 31.



Number of free database blocks in a given region.



Process-id of a process that has frozen the database associated with the region specified (using DSE or MUPIP).

If the region is currently not frozen, returns zero.



Returns a string describing the current compiler setting. The default is "GT.M Boolean short-circuit".



Truth Value indicating whether Database block certification is currently enabled or disabled.

To enable or disable Database block certification, use the VIEW "GDSCERT" command.



Access method of the region.



Name of the database associated with the region.



Name of the first database region in the current global directory; functionally equivalent to $VIEW("GVNEXT","").



Name of the next database region after the given one in alphabetical order (or M collation sequence); "" for region starts with the first region. A return value of "" means that the global directory defines no additional regions.



Encoded information about database behavior since segment creation. It also includes SET operations even if they are inside a TP transaction.

If you require completely accurate GVSTATS, you need to ensure the last process to close a database always has write access to the database files. If read-only processes are the active processes in a database, they cannot update the database and may delete the shared memory where they have stored the counts of their actions (for example, the number of blocks read).



Number of indirection cache hits since GT.M process startup.

Indirection cache is a pool of compiled expressions that GT.M maintains for indirection and XECUTE.



Number of indirection cache misses since GT.M process startup.



can return the following values:

  • -1 (internal error)

  • 0 journaling is disabled

  • 1 journaling is enabled but closed (OFF)

  • 2 journaling is enabled and open (ON)



Journal file name associated with the region.



Index showing how many ZTSTART transaction fences have been opened (and not closed).



Truth value showing whether label case sensitivity is ON (1 for "LOWER") or OFF (0 for "UPPER"); GT.M defaults to 1.



Returns the current relink recursive setting of ZLINK.


local variable name (lvn)

returns the number of references by alias containers to the array associated with an unsubscripted local variable name specified as a second expr (for example a quoted string); it returns a zero for a variable without any associated alias container.



returns the number of data-spaces recovered during a local variable data-space garbage collection it triggers; such collections normally happen automatically at appropriate times.


local variable name (lvn)

returns the total number of references to the data-space associated with an unsubscripted local variable name specified as a second expr (for example a quoted string).



Truth value showing whether null subscripts are permitted in local arrays (1 for "LVNULLSUBS") or not (0 for "NOLVNULLSUBS"); GT.M defaults to 1.



The current isolation-status of the specified global variable which must have a leading "^" in its specification.

This function returns 1 if GT.M has been instructed to not enforce the ACID property of Isolation (that is, "NOISOLATION" has been specified) and 0 otherwise.

By default, GT.M ensures Isolation, that is, a $VIEW command will return 0. The isolation-status of a global variable can be turned on and off by the VIEW "NOISOLATION" command.



Name of the region(s) holding the specified gvn.

If gvn spans more than one region, this function returns region name in an order where the first region is the region to which the unsubscripted global variable name maps; and other regions are in the order in which they would be encountered by traversing the subscripts of gvn in order (with duplicates removed).

gvn is a subscripted or unsubscripted global variable name in the same form as that generated by $NAME(). You can use $NAME() inside $VIEW() to ensure that subscripts are in a correct form, for example, $VIEW("REGION",$NAME(^abcd(1,2E4))) instead of $VIEW("REGION","^abcd(1,20000)").



Name of the active patcode table; GT.M defaults this to "M".


routine name

Returns the source check-sum for the most recently ZLINK'd version of the specified routine name.


routine name

Name of the next routine in the image after the given one; "" (empty string) for routinename starts with the first routine in ASCII collating sequence and a return value of the empty string indicates the end of the list.



Number of bytes in the currently allocated as process working storage. GT.M manages this space as what is commonly called a heap, and uses the term stringpool to refer to it. The GT.M garbage collector reclaims unused space from the stringpool from time to time, and GT.M automatically expands the stringpool as needed by the application program.



Returns the GT.M stack size in bytes.



Total number of database blocks in a given region.




transaction level

Transaction ID specified in the particular level (when the transaction level is specified). The first level TSTART is returned if the level is not specified as second argument.

[Note] Note

A NULL string is returned if the specified level (explicitly or implicitly) is greater than the current value of $TLEVEL.



Truth value showing whether undefined variables should be treated as having a null value (1 for "UNDEF"; 0 for "NOUNDEF"); GT.M defaults to 0.



Displays the database representation of gvn where gvn is a global name or a global name with subscript(s). The option collnum specifies the alternate collation sequence number. If collnum is not specified, GT.M assumes the default ASCII collation(collnum=0). For example:

GTM>set x=$VIEW("YGVN2GDS","^A(1,""abcd"")") zwrite x for i=1:1:$zlength(x) write $zascii($zextract(x,i))," "
x="A"_$C(0)_" "_$C(17,0,255)_"abcd"_$C(0,0)
65 0 191 17 0 255 97 98 99 100 0 0 



Displays the global name or a global name with subscript(s) of a database representation gds. The option collnum specifies the collnum specifies the alternate collation sequence number. If collnum is not specified, GT.M assumes the default ASCII collation(collnum=0). This function is the inverse of the $VIEW("YGVN2GDS",<gvn>[,collnum]) function. For example:

GTM>set y=$VIEW("YGDS2GVN",x) zwrite y




Integer value showing whether four digit year code is active for $ZDATE(); GT.M defaults to 0 (for "YY" format). Use the environment variable gtm_zdate_form to set the initial value of this factor. For usage examples, refer to “$ZDate()”.

[Important] Important

FIS uses the LC_CREF, LV_GCOL, LV_REF keywords in testing and is documenting them to ensure completeness in product documentation. They may (or may not) be useful during application development for debugging or performance testing implementation alternatives.

Examples of $VIEW()


GTM>Set a=1,*b(1)=a

GTM>write $view("LV_CREF","a")," ",$view("LV_CREF","b")
1 0
GTM>write $view("LV_REF","a")," ",$view("LV_REF","b")  
2 1

This example creates an alias variable and an alias container variable and checks the number of both container references and total references to the cells associated with both a and b.


GTM>Set *a(1)=b,*b(1)=a

GTM>kill *a,*b

GTM>write $view("LV_GCOL")

This example creates two cross associated alias containers, destroys their ancestor nodes with KILL * and uses $VIEW("LV_GCOL") to force a clean-up of the abandoned data-spaces. In the absence of the $VIEW("LV_GCOL"), GT.M would do this automatically at some subsequent convenient time.


GTM>write $view("GVSTAT","DEFAULT")

These are statistics associated with the DEFAULT region. Refer to “ZSHOW Information Codes” for information on the parameters.


Given the following global directory configuration:

GDE>add    -name a(1:10)                         -region=a1
GDE>add    -name a(10,1)                         -region=a2
GDE>add    -name a(10,2) 	                     -region=a3
GDE>add    -name a(120:300)                      -region=a4
GDE>add    -name a(60:325)                       -region=a5
GDE> show   -name
         *** NAMES ***
 Global                             Region
 *                                  DEFAULT
 a(1:10)                            A1
 a(10,1)                            A2
 a(10,2)                            A3
 a(60:120)                          A5
 a(120:300)                         A4
 a(300:325)                         A5

Here are some $VIEW("REGION",gvn) outputs:

GTM>write $view("REGION","^a(1)")
GTM>write $view("REGION","^a(10)")
GTM>w $view("REGION","^a(60)")
GTM>w $view("REGION","^a")