$ZGetjpi()
$ZGetjpi()
Returns job or process information of the specified process. The format for the $ZGETJPI function is:
$ZGETJPI(expr1,expr2)- expr1 identifies the PID of the target job. If expr1 is an empty string (""), $ZGETJPI() returns information about the current process.
- expr2 specifies the item keyword identifying the type of information returned; keywords may be upper, lower, or mixed-case. The keywords are as follows:
ZGETJPI() Keywords Data returned ISPROCALIVE Determines whether the specified process is alive. CPUTIM Total process and child CPU time used in hundredths of a second. CSTIME System time of child processes CUTIME User time of child processes STIME Process system time UTIME Process user time - Note that the $ZGETJPI() retrieves process time measurements (CPUTIM, CSTIME, CUTIME, STIME, and UTIME) only of the current process ($JOB). The “child” process time includes ZSYSTEM and PIPE device sub-processes (only after the PIPE CLOSEs), but excludes processes created by the JOB command.
- $ZGETJPI() provides a tool for examining the characteristics of a UNIX process. Accessing information about processes belonging to other users requires certain UNIX privileges. Consult your system manager if you require additional privileges.
Examples
Example:
GTM>write $zgetjpi(1975,"isprocalive")
1
GTM>This uses $ZGETJPI() to determine whether process 1975 is alive.
Example:
GTM>set t=$zgetjpi("","cputim")
GTM>do ^bench write $zgetjpi("","cputim")-t
1738
GTM>This uses $ZGETJPI() to measure the actual CPU time, measured in hundredths of a second, consumed by running the ^bench routine.