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.

Structured System VariablesValue01MeaningJob does not exist.Job exists.The following example tests for the existence of a <strong>Caché</strong> process.SET x=$JOBWRITE !,$DATA(^$JOB(x))The variable x is set to the job number of the current process (for example: 4294219937).The WRITE returns the boolean 1, indicating this process exists.As an Argument to $ORDER$ORDER(^$JOB(job_number),direction)^$JOB as an argument to $ORDER returns the next or previous ^$JOB job number in collatingsequence to the job number you specify. If no such job number exists as a ^$JOB node,$ORDER returns a null string.The direction argument specifies whether to return the next or the previous job number. Ifyou do not provide a direction argument, <strong>Caché</strong> returns the next job number in collatingsequence to the one you specify. For further details, refer to the $ORDER function.The following subroutine searches the <strong>Caché</strong> job table and stores the job numbers in a localarray named JOB.JOBSET PID=""FOR I=1:1 {SET PID=$ORDER(^$JOB(PID))QUIT:PID=""SET JOB(I)=PID}WRITE "Total Jobs in Job Table: ",IQUITAs an Argument to $QUERY$QUERY(^$JOB(job_number))^$JOB as an argument to $QUERY returns the next ^$JOB job number in collating sequenceto the job number you specify. If no such job number exists as a node in ^$JOB, $QUERYreturns a null string.The following example returns the first two jobs in the <strong>Caché</strong> job table. Note the use of theindirection operator (@):506 <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!