Structured System variables -- ^$JOB

^$J[OB]

Introduced in the 1995 ANSI M[UMPS] language standard.

This structured system variable provides information about the processes that are currently known to the M[UMPS] system.

WRITE !,"Currently active jobs:"
WRITE !,"Job"
WRITE ?12,"Character set"
WRITE ?30,"Global Environment"
WRITE ?50,"LOCK Environment"
WRITE ?70,"Routine Environment"
SET J="" FOR  SET J=$ORDER(^$JOB(J)) QUIT:J=""  DO
. WRITE !,J
. WRITE ?12,$GET(^$JOB(J,"CHARACTER"))
. WRITE ?30,$GET(^$JOB(J,"GLOBAL"))
. WRITE ?50,$GET(^$JOB(J,"LOCK"))
. WRITE ?70,$GET(^$JOB(J,"ROUTINE"))
. QUIT

The routine

GSIZE(ENV,NAME) ;
 NEW OLDENV,REF,SIZE
 SET OLDENV=^$JOB($JOB,"GLOBAL")
 SET ^$JOB($JOB,"GLOBAL")=ENV
 SET REF="^"_NAME,SIZE=0
 FOR  DO  SET REF=$QUERY(@REF) QUIT:REF=""
 . SET SIZE=SIZE+$LENGTH(REF)+$LENGTH($GET(@REF))
 . QUIT
 SET ^$JOB($JOB,"GLOBAL")=OLDENV
 QUIT SIZE

would compute the size of a global variable in an arbitrary environment.

Approved for addition in a future ANSI M[UMPS] language standard.

If your implementation has granted you the privilege to do so, you may be able to remove a job from the system by executing the command
KILL ^$JOB(number)

^$JOB(job,"$PRINCIPAL") and ^$JOB(job,"$IO") show the principal and current devices for the various processes.

^$JOB(job,"OPEN",device) provides a list of devices that are open for a given process.

^$JOB(job,"DEVICE") specifies the default environment in which the process can OPEN, USE and CLOSE devices.

^$JOB(job,"LIBRARY",sequence)=library specifies the set of libraries that is currently available to a job, and the order in which these libraries are searched for entry-points.

^$JOB(job,"USER") is intended to contain an implementation-specific value that identifies the current user. At the start of a M[UMPS] process, the implementation may or may not provide an initial value. When this variable has no defined value, a M[UMPS] process may define a value for it; once this variable has a defined value; no M[UMPS] process may modify this value.

^$JOB(job,"GROUP") is intended to contain an implementation-specific value that identifies the group of which the current user is a member. At the start of a M[UMPS] process, the implementation may or may not provide an initial value. When this variable has no defined value, a M[UMPS] process may define a value for it; once this variable has a defined value; no M[UMPS] process may modify this value.

^$JOB(job,"VAR",name) may be used to access the local symbol table of a process. The following code could be used to capture the state of a process in an error handler:

 LOCK +^ERROR("NEW")
 SET (^ERROR,%error)=$GET(^ERROR)+1
 LOCK -^ERROR("NEW")
 MERGE ^ERROR(%error)=^$JOB($JOB,"VAR")
 KILL ^ERROR(%error,"%error") ; only variable used
Approved for addition in a future ANSI M[UMPS] Windowing Application Programmer's Interface standard.

The ability to process events in an asynchronous fashion is introduced. The commands ABLOCK, ASTART, ASTOP and AUNBLOCK allow for starting and stopping recognition of certain events. The structured system variable ^$JOB is used to register the entry point this is intended to be started when a certain event occurs. Nodes in ^$EVENT are used to specify other specific behavior of the various events.

^$JOB($JOB,"EVENT",eventclass,eventid)=entryref identifies the events that are enabled for event processing. Possible values for eventclass are explained with the command ABLOCK. Possible values of eventid depend on the event class.

^$JOB($JOB,"EVENT",eventclass,eventid,"MODE") may have one of three possible values: "DISABLED", "SYNCHRONOUS" or "ASYNCHRONOUS". The value of this node identifies the processing mode for the specified event and the specified process.

^$JOB($JOB,"EVENT",eventclass,eventid,"BLOCKS") has an integer value. This value is either zero or a positive integer number. When this value is non-zero, it indicates the number of blocks (see the commands ABLOCK and AUNBLOCK) that have been issued for the event.


This document is © Ed de Moel, 1995-2005.
It is part of a book by Ed de Moel that is published under the title "M[UMPS] by Example" (ISBN 0-918118-42-5).
Printed copies of the book are no longer available.

This document describes the various special (system) variables that are defined in the M[UMPS] language standard (ANSI X11.1, ISO 11756).

The information in this document is NOT authoritative and subject to be modified at any moment.
Please consult the appropriate (draft) language standard for an authoritative definition.

In this document, information is included that will appear in future standards.
The MDC cannot guarantee that these 'next' standards will indeed appear.