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". $VIEW("FULL_BOOLEAN") reports "Standard Boolean evaluation side effects" when it is not explicitly set, but that mode of operation is required by the setting of gtm_side_effects, and "Standard Boolean side-effect warning" when warnings have been specified.



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.



A read-only process cannot update the database including the database file header where GVSTATS are stored. Another process with write access to a database, such as MUPIP RUNDOWN, can flush its read statistics from the associated shared memory to GVSTATS.



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 active patcode table; GT.M defaults this to "M".



The current limit on global buffers for the region .



Acquires and releases a critical section for the region (the "probe"), returning a string containing following fields, some of of which always have zero (0) values because they are no longer used:

  • CPT - nanoseconds for the probe to get the critical section

  • CFN - 0

  • CQN - 0

  • CYN - 0

  • CQF - 0

  • CQE - 0

  • CAT - total of critical section acquisitions successes



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)").


routine name

Source code check-sum for the most recently ZLINK'd version of the specified routine name (these check-sums use a 128 bit hash based on the MurmurHash3 algorithm).


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.



Returns a string with three comma separated values: Number of bytes 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; Number of bytes currently used by the process; Number of bytes reserved: The reserved space is used to reduce the active memory usage, for example, when a process uses a large amount of memory then subsequently uses a significantly reduced amount.



Returns 0 when the process has sharing disabled, 1 when it has sharing enabled, and 2 when sharing is enabled selectively for regions. For a process to store statistics in the stats db, the database must be enabled for sharing and the process must have opted in to share. VIEW "STATSHARE" with no region argument enables sharing for all regions and VIEW "STATSHARE":"REGION_NAME" enables sharing selectively for a region. $VIEW("STATSHARE","REGION_NAME") returns whether a process has opted to share statistics for a region.



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.



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")