vmsobj_xabdat object

(PYVMS LOGO) Python on OpenVMS

(go to: table of contents, index, list of VMS objects, prev: vmsobj_xaball, next: vmsobj_xabfhc)

The vmsobj_xabdat object provides high-level access to an OpenVMS XABDAT (DAte and Time XAB (eXtended Attribute Block)) data structure. You DO need access to the 'OpenVMS Record Management Services Reference Manual'! The PYVMS documentation will neither list all possible attributes (although you can find them by looking into the file VMSOBJ_XABDAT.C) nor will it explain the use of each field in a XABDAT.

A 'vmsobj_xabdat' object does not have any bitmasks or constants which means there is no 'vms_xabdatdef' module.


Attributes:

Most BWLQ,M attributes can be directly read and written as shown in the introduction. Attributes with a 'Q' (quadword - 128-bit datatype) are returned as a signed 'Python long integer'. See GENMAN 'Programming', 'special OpenVMS datatypes' for details.

Exceptions are noted below:

NXT
Read/write access for a(nother) vmsobj_xabXXX object. The readonly attribute "L_NXT" returns the memory address of the OpenVMS XAB that was connected to the XABDAT. Remember that each XAB contains a "NXT" / "L_NXT" attribute to build a chain of multiple XABs.
>>> xabdat = pyvms.vmsobj_xabdat ()
>>> type (xabdat)
<type 'vmsobj_xabdat'>
>>>
>>> print xabdat.NXT
None
>>> print xabdat.L_NXT
0
>>>
>>> # this example uses a XABALL
>>> xaball = pyvms.vmsobj_xaball ()
>>> type (xaball)
<type 'vmsobj_xaball'>
>>>
>>>
>>> xabdat.NXT = xaball
>>> xaball
<vmsobj_xaball, XABALL at 0x0021a368>
>>> xabdat.NXT
<vmsobj_xaball, XABALL at 0x0021a368>
>>> hex (xabdat.L_NXT)
'0x21a368'
>>>
>>>
>>> xabdat.NXT = 0
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: must be a vmsobj_xabXXX object or None
>>>
>>> xabdat.L_NXT = 2
Traceback (innermost last):
  File "<stdin>", line 1, in ?
AttributeError: read-only vmsobj_xabdat attribute
>>>


Creation:

For now the 'pyvms' module contains a function to explicitly create a vmsobj_xabdat object within Python.

Examples:

>>> import pyvms

>>> # create a vmsobj_xabdat object
>>>
>>> xabdat = pyvms.vmsobj_xabdat ()
>>> type (xabdat)
<type 'vmsobj_xabdat'>
>>> xabdat
<vmsobj_xabdat, XABDAT at 0x001eaa78>
>>>


>>> # invalid attribute access
>>> xabdat.no_attr = 0
Traceback (innermost last):
  File "<stdin>", line 1, in ?
AttributeError: non-existing vmsobj_xabdat attribute
>>> xabdat.no_attr
Traceback (innermost last):
  File "<stdin>", line 1, in ?
AttributeError: no_attr
>>>

Use:
>>> import pyvms
>>>
>>> fab = pyvms.vmsobj_fab()
>>> fab.FNA = 'dcc_vms.com'
>>>
>>> xabdat = pyvms.vmsobj_xabdat()
>>> fab.XAB = xabdat
>>> import vms_sys
>>>
>>> status = vms_sys.open (fab)
>>> print status
65537
>>> vms_sys.getmsg (status)
('%RMS-S-NORMAL, normal successful completion', (0, 0, 0, 0))
>>>
>>> vms_sys.asctim (xabdat.Q_CDT)
'14-MAR-1999 20:01:59.92'
>>> vms_sys.asctim (xabdat.Q_RDT)
'14-MAR-1999 20:02:00.29'
>>>
... @@
(go to: table of contents, index, list of VMS objects, prev: vmsobj_xaball, next: vmsobj_xabfhc)

23-MAR-1999 ZE.