(PYVMS LOGO) Python on OpenVMS

(go to: table of contents, index, list of vms_sys, prev: SETPRI, next: SETPRV)


SETPRN - Set Process Name


Format:
    vms_sys.setprn ([prcnam])
Returns:

None. But you can get the current process name using vms_lib.getjpi() with the 'JPI$_PRCNAM' item code - see example below.

Arguments:

prcnam
Process name to be given to the calling process.
Examples:
$ SET PROCESS/NAME="OLD_PRCNAM"

>>> import vms_lib
>>> import vms_sys

>>> vms_lib.getjpi ('JPI$_PRCNAM',0)
(160, 'OLD_PRCNAM')
>>> vms_sys.setprn ('NEW_PRCNAM')
>>> vms_lib.getjpi ('JPI$_PRCNAM',0)
(160, 'NEW_PRCNAM')

>>> # an empty argument results in a process with no name.
>>> vms_sys.setprn ()
>>> vms_lib.getjpi ('JPI$_PRCNAM',0)
(160, '')

>>> vms_sys.setprn ('NEW_PRCNAM')
>>> vms_lib.getjpi ('JPI$_PRCNAM',0)
(160, 'NEW_PRCNAM')

>>> vms_sys.setprn (None)
>>> vms_lib.getjpi ('JPI$_PRCNAM',0)
(160, '')

>>> vms_sys.setprn (1)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: argument 1: expected read-only buffer, int found

>>> vms_sys.setprn (None,2)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: function requires at most 1 argument; 2 given

>>> vms_sys.setprn ('THIS_PROCESS_NAME_IS_INVALID')
Traceback (innermost last):
  File "<stdin>", line 1, in ?
vms_sys.error: (340, '%SYSTEM-F-IVLOGNAM, invalid logical name')

>>> # Note: a process with the name 'DUP_PRCNAM' does
>>> #       already exist in the same UIC group.
>>> vms_sys.setprn ('DUP_PRCNAM')
Traceback (innermost last):
  File "<stdin>", line 1, in ?
vms_sys.error: (148, '%SYSTEM-F-DUPLNAM, duplicate name')
>>>

(go to: table of contents, index, list of vms_sys, prev: SETPRI, next: SETPRV)

28-SEP-1998 ZE.