(go to: table of contents, index, list of vms_lib, prev: GETDVI, next: GETQUI)
Format:
special notes about some item codes:
GETJPI - Get Job/Process Information
This routine allows the programmer to receive a single item of information
from the specified process per call.
The vms_sys.getjpiw() routine provides
support to request multiple items at once at the expense of additional work
to extract the data from the returned dictionary.
Note: the 'vms_jpidef' module contains
bitmasks and constants that are defined in '$JPIDEF'. Access to the item codes
("JPI$_name") is possible via the 'pyvms' module.
10-FEB-1999 ZE.
ctx_out, item_value = \
vms_lib.getjpi (item_name, pid_ctx [,process_name])
Returns:
Arguments:
Examples:
>>> import vms_lib
>>> import vms_sys # ASCTIM
>>> pid, state = vms_lib.getjpi ('JPI$_STATE',0)
>>> pid, state
(232, 14)
>>> # this is vms_statedef.SCH_C_CUR
>>> vms_lib.getjpi ('JPI$_PRCNAM',65)
(65, 'SWAPPER')
>>> vms_lib.getjpi ('JPI$_PID',None,'DEST_PROC')
(1058, 1058)
>>> vms_lib.getjpi ('JPI$_PRCNAM',1058)
(1058, 'DEST_PROC')
>>> l_pid, q_lgitim = vms_lib.getjpi ('JPI$_LOGINTIM', 0)
>>> l_pid, q_lgitim
(341, 44135430131500000L)
>>> import vms_sys # ASCTIM
>>> vms_sys.asctim (q_lgitim)
'26-SEP-1998 16:10:13.15'
>>> vms_lib.getjpi ('JPI$_PID',1234)
Traceback (innermost last):
File "<stdin>", line 1, in ?
vms_lib.error: (2280, '%SYSTEM-W-NONEXPR, nonexistent process')
>>> vms_lib.getjpi ('JPI$_PID',sys)
Traceback (innermost last):
File "<stdin>", line 1, in ?
TypeError: argument 2: process-id - must be integer or None
>>> vms_lib.getjpi ('JPI$_PID',None,None)
Traceback (innermost last):
File "<stdin>", line 1, in ?
vms_lib.error: (340, '%SYSTEM-F-IVLOGNAM, invalid logical name')
>>> vms_lib.getjpi ('JPI$_PID',None,sys)
Traceback (innermost last):
File "<stdin>", line 1, in ?
TypeError: argument 3: expected read-only buffer, module found
>>> vms_lib.getjpi ('JPI$_PID',None,1)
Traceback (innermost last):
File "<stdin>", line 1, in ?
TypeError: argument 3: expected read-only buffer, module found
*** example of wildcard lookup ***
>>> ctx = -1
>>> while 1:
... ctx,pid = vms_lib.getjpi ('JPI$_PID',ctx)
... x,pn = vms_lib.getjpi ('JPI$_PRCNAM',pid)
... x,li = vms_lib.getjpi ('JPI$_LOGINTIM',pid)
... print ctx,pid,pn,vms_sys.asctim(li)
... #-while
...
-65535 65 SWAPPER 17-NOV-1858 00:00:00.00
-65531 69 IPCACP 10-MAR-1996 13:23:00.36
-65530 70 ERRFMT 10-MAR-1996 13:23:02.14
[...]
-65527 73 JOB_CONTROL 10-MAR-1996 13:23:08.72
-65526 74 QUEUE_MANAGER 10-MAR-1996 13:23:09.25
-65525 75 SECURITY_SERVER 10-MAR-1996 13:23:12.84
Traceback (innermost last):
File "<stdin>", line 2, in ?
vms_lib.error: (2472, '%SYSTEM-W-NOMOREPROC, no more processes')
>>>
(go to: table of contents,
index,
list of vms_lib,
prev: GETDVI,
next: GETQUI)