Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples
Left Hand Pointer

^$JOB

M[UMPS] by Example

Right Hand Pointer

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

Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples

Copyright © Standard Documents; 1977-2017 MUMPS Development Committee;
Copyright © Examples: 1995-2017 Ed de Moel;
Copyright © Annotations: 2003-2017 Jacquard Systems Research.

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

Some specifications are "approved for inclusion in a future standard". Note that the MUMPS Development Committee cannot guarantee that such future standards will indeed be published.

This page most recently updated on 13-Sep-2014, 11:38:44 .

For comments, contact Ed de Moel (demoel@jacquardsystems.com)