11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Caché</strong> <strong>ObjectScript</strong> Special Variables$JOBContains the ID of the current process.$JOB$JDescription$JOB contains the ID number of the current process. This ID number is the host operatingsystem's actual process ID (PID). This ID number is unique for each process.The ID number for an I/O process (such as a <strong>Caché</strong> terminal process) is part of the stringcontained in the $IO special variable.The format of the string returned to $JOB is determined by the setting of the $ZUTIL(68,42)or $ZUTIL(69,42) functions. By default $JOB returns only the 10-digit PID, but you canset these functions to have $JOB return both the PID and the node name. If you change thesetting of this switch, you must recompile any routines that use the string returned to $JOBin arithmetic operations where $JOB is converted to an integer.This special variable cannot be modified using the SET command. Attempting to do so resultsin a error.To return the PID as the terminal prompt, use $ZUTIL(186,5).Other Information About the Current ProcessYou can obtain the same current process ID number by invoking a system method, as follows:WRITE $SYSTEM.SYS.ProcessID()Refer to the “Class %SYSTEM.SYS” section of the <strong>Caché</strong> Class <strong>Reference</strong> for further details.You can use $JOB to obtain the job number for the current process as follows:ZNSPACE "%SYS"SET Job=##CLASS(SYS.Process).%OpenId($JOB)WRITE Job.JobNumberRefer to the “Class SYS.Process” section of the <strong>Caché</strong> Class <strong>Reference</strong> for further details.You can obtain status information about the current process from the $ZJOB special variable.You can obtain the PID of the child process or the parent process of the current process fromthe $ZCHILD and $ZPARENT special variables.438 <strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!