TMF Application Programmer's Guide (G06.24+)
TMF ARLIB2 Audit-Reading Procedures
HP NonStop TMF Application Programmer’s Guide—522419-004
5-5
Retrieving Information From Audit Records
COMMIT and NETWORK-ABORT (RECTYPE constants 18 and 19, respectively). To
retrieve NETWORK-COMMIT and NETWORK-ABORT records, you call
ARGETNETWORKRECS prior to the first call to ARREAD. Conversely, the
ARSTOPNETWORKRECS procedure disables the returning of NETWORK-COMMIT
and NETWORK-ABORT records. (Alternatively, you can use ARSETOPTIONS to
change the network options.)
For Enscribe and SQL/MP, you read the variable-length fields from audit records
separately by calling the ARFETCH objectname procedure immediately after using
ARREAD. The seven object names are AFTERIMAGE, AUXPOINTER,
BEFOREIMAGE, CHILDNODELIST, FIELDVALUE, FRAGMENT, and RECORDKEY.
For SQL/MX, you read the variable-length fields from audit records separately by
calling the ARFETCHMXBEFOREDATA, ARFETCHMXBEFOREDATA2,
ARFETCHMXAFTERDATA, or ARFETCHMXAFTERDATA2 procedures.
The before-image, after-image, and record key are copied into your application buffer
byte-for-byte. For audit records that contain variable-length fields, the byte length of
such fields is specified in the record returned by ARREAD. The auxiliary pointer is a
structure specifying a range of audit in an audit trail. The child node list is an array of
32-bit system numbers that starts in the first word of the specified application buffer.
For audit records that include a child node list, the number of elements (child nodes) in
the list is specified in the record returned by ARREAD. Fragment is a pair of before-
and after-image fragments from a compressed Enscribe update record. If you issue a
fetch procedure call for a variable-length field that is not present in the record most
recently returned by ARREAD, the procedure returns an error -17 (ARE-FIELD-NOT-
PRESENT).
To fetch one or more variable-length fields from an audit record, you must first have
read the record by using the ARREAD procedure. ARREAD saves information about
each record it reads and the fetch procedures use that information to retrieve the
associated variable-length fields. Calls to AROPEN, ARCLOSE, or ARPOSITION
erase that information; after such calls, further fetch attempts will fail with an error -9
(ARE-NO-CURRENT-RECORD) until the next successful call to ARREAD.
How you go about retrieving the key or record address of a data record whose
modification is recorded in the audit trail depends upon the file type and the type of
audit record.
•
For key-sequenced files, the key of the record is present in the before-image and
after-image of the record. Because these images are not available for the
UPDATE AUDITCOMP record, the key is stored separately in the audit record and
must be fetched by using the ARFETCHRECORDKEY procedure. For an
UPDATE FIELDCOMP record, you use the ARFETCHFIELDVALUE procedure to
retrieve the before-image and after-image fields.
•
For entry-sequenced, relative, and unstructured files, you use the
ARGETRECADDR and ARGETRECADDR64 procedures to retrieve the record
address.