Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRIS, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions page (login required).

Previous sectionNext section


Returns the operating system type.




The only supported parameter value is the number 1.


$ZVERSION(1) returns the current operating system type as an integer code. It returns the following values: 2 for Windows, 3 for UNIX®, and 0 if not known.

You can use the isWINDOWS and isUNIX system-supplied macros to return the same information as a boolean value.

You can use the %SYSTEM.Version.GetOS() to return the same information as a string.

You can use the $ZVERSION special variable to return complete Caché version information, including the current operating system type.


The following example returns the current operating system type:

#Include %occInclude
  WRITE "OS type as code: ",$ZVERSION(1),!
  WRITE "OS type as Boolean: ",!
  WRITE "Windows? ",$$$isWINDOWS,"  UNIX? ",$$$isUNIX,!
  WRITE "OS type as string: ",$SYSTEM.Version.GetOS(),!
  WRITE "Caché Version: ",$ZVERSION
Copy code to clipboard

See Also