Skip to main content

$SYSTEM (ObjectScript)

Contains system information about system objects.

Synopsis

$SYSTEM 
$SY  
$SYSTEM.class.method()

Description

$SYSTEM can be invoked as either a special variable or as a class which invokes methods that return system information.

$SYSTEM Special Variable

$SYSTEM as a special variable contains the local system name and the name of the current instance of InterSystems IRIS, separated by a colon (:). The name of the machine follows the case conventions of the local operating system and the name of the instance is in uppercase. For example:

MyComputer:IRISInstance

You can also determine your local system name using the LocalHostName()Opens in a new tab method:

  WRITE $SYSTEM,!
  WRITE $SYSTEM.INetInfo.LocalHostName() 

The abbreviation $SY can only be used for $SYSTEM as a special variable.

$SYSTEM Class

$SYSTEM as a class provides access to a variety of system objects. You can invoke a method that returns information, or a method that performs some operation such as upgrading or loading and returns status information. InterSystems IRIS supports several classes of system objects, including the following:

  • Version: for version numbers of InterSystems IRIS and its components

  • SYS: for the system itself

  • OBJ: for Objects

  • SQL: for SQL queries

Note that object class names and method names are case-sensitive. Specifying the wrong case for these names results in a <CLASS DOES NOT EXIST> or <METHOD DOES NOT EXIST> error. If you do not specify parentheses with the method name, it issues a <SYNTAX> error.

$SYSTEM methods and properties can be accessed using dot syntax, as shown in the following equivalent syntax examples:

  • WRITE ##class(%SYSTEM.INetInfo).LocalHostName()

  • WRITE $SYSTEM.INetInfo.LocalHostName()

$SYSTEM can access the System API classes in the %SYSTEM class package, described in the InterSystems Class Reference documentation. Note that in the ##class syntax the %SYSTEM class package name is case-sensitive. In the $SYSTEM syntax the $SYSTEM keyword is not case-sensitive. For further information on using dot syntax, see Working with Registered Objects.

For further information on using %SYSTEM.OBJOpens in a new tab, refer to Flags and Qualifiers.

Examples

The following is an example of using $SYSTEM to invoke a method that displays a list of the classes available in the current namespace:

   DO $SYSTEM.OBJ.ShowClasses()

This displays results like the following:

%SYS>d $system.OBJ.ShowClasses()
%SYS.APIManagement
%SYS.Audit
%SYS.AuditString
%SYS.ClusterInfo
%SYS.DatabaseQuery
...
SYS.WSMon.wsProcess
SYS.WSMon.wsResource
SYS.WSMon.wsSystem
 

You can list all of the methods for the OBJ class as follows. (By changing the class name, you can use this method to get a list for any system class):

   DO $SYSTEM.OBJ.Help()

To list information about just one method in a class, specify the method name in the Help argument list, as shown in the following example:

   DO $SYSTEM.OBJ.Help("Load")

The following are a few more examples of $SYSTEM that invoke methods:

   DO $SYSTEM.OBJ.Upgrade()
   WRITE !,"* * * * * * * * * * * "
   DO $SYSTEM.CSP.DisplayConfig()
   WRITE !,"* * * * * * * * * * * "
   WRITE !,$SYSTEM.Version.GetPlatform()
   WRITE !,"* * * * * * * * * * * "
   WRITE !,$SYSTEM.SYS.TimeStamp()

The following example calls the same methods as the previous example, using the ##class(%SYSTEM) syntax form:

   DO ##class(%SYSTEM.OBJ).Upgrade()
   DO ##class(%SYSTEM.CSP).DisplayConfig()
   WRITE !,##class(%SYSTEM.Version).GetPlatform()
   WRITE !,##class(%SYSTEM.SYS).TimeStamp()

The previous two examples requires that UnknownUser have assigned the %DB_IRISSYS role.

See Also

Purpose of this instance: Draft documentation
DocReleaseID: HealthConnect2025.1
Content loaded from:
/staging/learning/iris-doc/2025.1.x/doc/cache/en-us/src/
/staging/learning/iris-doc/2025.1.x/doc/ensemble/en-us/src/
/staging/learning/iris-doc/2025.1.x/doc/healthconnect/en-us/src/
/staging/learning/iris-doc/2025.1.x/doc/healthcommon/en-us/src/
/staging/learning/iris-doc/2025.1.x/doc/security/en-us/src/
Excluded items: AADAN, ABIT, ACLOUD, AFL_adonet, AFL_ecp, AFL_icm, AFL_jdbc, AFL_netxep, AFL_sharding, AFL_xep, APMML, APOWER, ARGATEWAY, AWEBSOCKETS, AWSGI, BJAVA, BJAVNAT, BJAVPER, BJAVXEP, BJSNAT, BNET, BNETNAT, BNETODBC, BNETXEP, BPYNAT, BSPK, BTPI, BXCI, GAUTOML, GCONV, GCSP, GICM, GIKNOW, GIML, GISQ, GISR, GSCF, GSQLSRCH, GTSQ, GUIMA, PAGE_activex, PAGE_administration, PAGE_apimgr, PAGE_appdev_ides, PAGE_bi, PAGE_cachedirect, PAGE_data_migration, PAGE_data_science, PAGE_deployment, PAGE_deployment_configuration, PAGE_deployment_containers, PAGE_deployment_icm, PAGE_deployment_iko, PAGE_deployment_install, PAGE_dotnet, PAGE_dotnet_native, PAGE_dsvr, PAGE_embedded_language_development, PAGE_epython, PAGE_external_language_development, PAGE_interop, PAGE_interop_lifecycle, PAGE_interop_vdoc, PAGE_interoperability, PAGE_java, PAGE_java_jdbc, PAGE_java_native, PAGE_machine_learning, PAGE_monitoring, PAGE_multimodel, PAGE_multimodel_multidimensional, PAGE_multimodel_object, PAGE_multivalue, PAGE_native, PAGE_nodejs_native, PAGE_objectscript, PAGE_objectscript_ides, PAGE_odbc, PAGE_platform_arch_design, PAGE_pygate, PAGE_python, PAGE_python_native, PAGE_reports, PAGE_scalability, PAGE_security_authentication, PAGE_security_authorization, PAGE_studio, PAGE_zen, PAGE_zenmojo, PAGE_zenreports
FeedbackOpens in a new tab