Contains job status information.
contains a number in which each bit represents one particular aspect of the job’s status. $ZJOB
returns an integer that consists of the total of the set status bits. For example, if $ZJOB
= 5, this means that the 1 bit and the 4 bit are set.
To test individual $ZJOB
bit settings, you can use the integer divide
(\) and modulo
(#) operators. For example, $ZJOB\x#2
, where x
is the bit number. The following table shows the layout of the bits (by bit positional value), their settings and meanings:
||Job started from the Terminal prompt.
||Job started from a routine.
||Job started by the JOB command.
||Job started by signing on either at the Terminal prompt or from a routine.
||<INTERRUPT> enabled. A CTRL-C can interrupt a running program. Refer to BREAK flag for details.
||<INTERRUPT> disabled except for terminal lines for which <INTERRUPT> has been explicitly enabled by OPEN or USE commands.
||<INTERRUPT> received and pending.
||<INTERRUPT> not received. The value 8 is cleared by the OPEN and USE commands and by an error trap caused by a CTRL-C.
||Journaling is disabled regardless of other conditions.
||Journaling is enabled for this job if other conditions indicate journaling.
This special variable cannot be modified using the SET
command. Attempting to do so results in a <SYNTAX> error.
The following example returns $ZJOB
as an integer:
The following example returns each $ZJOB
WRITE " bit 1=",$ZJOB\1#2,!
WRITE " bit 2=",$ZJOB\2#2,!
WRITE " bit 4=",$ZJOB\4#2,!
WRITE " bit 8=",$ZJOB\8#2,!
WRITE "bit 1024=",$ZJOB\1024#2
Bit 1 can also be returned using $ZJOB#2
© 1997-2019 InterSystems Corporation, Cambridge, MA