TMF Application Programmer's Guide (G06.24+)

TMF ARLIB2 Audit-Reading Procedures
HP NonStop TMF Application Programmer’s Guide522419-004
5-10
Reading a Merged Audit Trail With a MERGE Cursor
Reading a Merged Audit Trail With a MERGE
Cursor
When using the ARLIB2 MERGE cursor, the application never sees AuxPointer
records. ARLIB2 merely uses those records to locate and return records from the
appropriate auxiliary audit trails.
The procedure for reading the MAT and all configured auxiliary audit trails as a merged
audit trail using the MERGE cursor is as follows:
1. Call AROPEN with "MERGE" as the generic-name for the cursor. Note that
“MERGE” functions as the audit-trail designator even if no auxiliary audit trails are
configured.
Specify the desired MAT low and high file-sequence numbers (min-seqno and
max-seqno). To designate the current active audit file as the high file-sequence
number, specify 999999 as the max-seqno.
2. Set the position in the MAT at which to start reading by calling ARPOSITION.
When you call ARPOSITION, you can also specify the desired starting position
within one of the configured auxiliary audit trails. If you specify both a MAT and
auxiliary position, however, they should be the values returned in an ARRECORD
or else unpredictable results may occur.
3. Retrieve successive audit records by repeatedly calling ARREAD.
When ARE-END-OF-AUDIT is returned, all audit records from the master and
auxiliary audit trails within the range determined by the ARPOSITION and
AROPEN calls have been returned.
If max-seqno in the AROPEN call was 999999, you have read to the end of the
merged audit trail. To retrieve newly added audit records, pause briefly and then
issue another ARREAD. That call will return either a new audit record (if available)
or an ARE-END-OF-AUDIT message. If the call returns a new audit record, issue
another ARREAD. If the call returns an ARE-END-OF-AUDIT, then pause once
again and issue another ARREAD, and so forth. Note that a MERGE cursor
cannot determine that additional data is written to an auxiliary audit trail until the
TMP writes an Aux Pointer record to the MAT.