Sequence file

Multiple sequence files are used to store audit-data for each table/company number combination. You can read the sequence files with the 4GL functions or the dictionary programs. The format of the sequence file name, where mmm refers to the module code and nnn means table number is: a mmmnnn company number.sequence file number

For example, these sequence files can exist for table ttadv999, company number 0:

aadv999000.000
aadv999000.001
aadv999000.002
aadv999000.003
....

The sequence file contains the table name and company number, followed by the sequence header, followed by transaction data of multiple transactions. Transaction data is followed by a transaction header and contains multiple audit rows generated for the transaction.

Sequence file layout

Field Length (bytes) Description
Table name 8 Str Name of the table
Company number 2 Int Company number of the table
Length of sequence header 2 Int The length of the next sequence header.
<sequence header>
<transaction header 1>
<transaction data 1>
<transaction header n> n = number of transactions in the sequence file (specified in the transaction header)
<transaction data n>

Transaction header format

You must log both the operating system user ID and the Enterprise Server user name, because a user can change the BSE_USER environment variable and use different Enterprise Server user names. In addition, different Enterprise Server users can have different table privileges in SQL databases. Programs can find the operating system logon name through the operating system user ID print.

Example

Operating system user ID        4
Baan User Name                  8
Date (YYYYMMDD)                 8
Time (HHMMSS)                   6
Session Name                   15

The transaction status can have one of these values:

  • COMMIT_DONE
  • ABORT_DONE
  • GATI_UTC_FLDS

From Infor Baan IVc onward, the status can also have these flags. You can find the values for these flags in the audit include file.

Note: The audit server no longer writes the PREPARE_DONE status.
Transaction Status                          1
Number of audit rows in the transaction     2

In addition, as of Infor Baan IVc, these fields are added at this position:

{
GATI 0                                     4
GATI 1                                     4
Commit Date (YYYYMMDD)                     8
Commit Time (HHMMSS)                       6
Reserved space                             8
}
Total bytes of data of this transaction    4

You must log both the operating system user ID and the Enterprise Server user name because a user can change the BSE_USER environment variable and use different Enterprise Server user names. In addition, different Enterprise Server users can have different table privileges in SQL databases. Programs can use the operating system user ID print to find the operating system logon name.

Field Length (bytes) Description
UNIX User Id 4 Int ID of the user on UNIX. On NT this field is 0.
Baan User Name 8 Str You must log both OS user ID and LN user name, because an OS user can change the BSE_USER environment variable to operate using different LN user names. Different LN users can have various table privileges in SQL databases. Therefore, you must store both. Using an OS user ID, print programs can find the UNIX logon name, and so on.
Old Commit Date/Time 14 Str Historical commit time in UTC. Format: YYYYMMDDhhmmss
Commit Date/Time 14 Str Commit time of transaction in UTC. Format: YYYYMMDDhhmmss. This Commit Date/Time is equal over all audit tables that are involved in this transaction. Change note: This field is only available from Infor Baan IVc onwards.
Session Name 15 Str Name of the session in which the transaction was carried out.
Transaction Status 1 Int This field can have one of these values: COMMIT_DONE, ABORT_DONE. From Enterprise Server onwards, the transaction status will be irrelevant, because the status is determined in the transaction notifications.
Number of Audit Rows in the Transaction 2 Int Number of audit rows for this table, so not all audit rows of the complete transaction.
Transaction ID 0 4 Int Change note: This field is only available from Infor Baan IVc onwards.
Transaction ID 1 4 Int Change note: This field is only available from Infor Baan IVc onwards.
Reserved Space 8 Change note: This field is only available from Infor Baan IVc onwards.
Total Bytes in Transaction 4 Int Total bytes of data of this transaction.

Transaction data format

Field Length (bytes) Description
Length of Row 2 Int Length of the audit row.
SNAT 4 Int Sequence Number in Audit Transaction.
Application Data 4 In every audit row, 4 bytes of space are kept to store application data. This data is stored and manipulated by 4GL applications and not by the audit server. The audit server just keeps the 4 bytes of extra space to be used later.
Type of Operation 1 Str Type of operation is a single character field, which indicates the database action performed on the table. These characters are used to indicate audited database actions:
  • C: Create Table.
  • L: Clear Table.
  • R: Drop (Remove) Table.
  • I: Insert row.
  • D: Delete row.
  • U: Update row.
Row Data ... In the audit row, the row data is present only for row-level actions. The field values, whenever stored, are stored in the same format as their data type. Therefore, the value for a long field is also stored as long in the audit row. Therefore, the length of each field entry in the audit row is the same as the length of the column.

For insert, the row data consists of field values, that is, the values to be inserted, of all audited fields, in the order in which they occur in the audit DD.

For delete, the row data consist of field values of the row to be deleted of all audited fields, in the order in which the values occur in audit DD.

In case of update, not all fields in the table can be updated. Yet for all fields, also those that have not been changed, the old and new values are stored. Field numbers are used to identify the fields. A field number for a field is its position in the audit DD, starting with field 0.

Change note: In versions before Infor Baan 5.0c the following holds for updates: In case of update, not all fields in the table can be updated. Therefore, apart from storing field values, an identifier is required to specify the field to which this data belongs. Here, field numbers are used to identify the fields. A field number for a field is its position in the audit DD (starting with field 0).

An entry for a field looks as follows:

  • Field Number: 2 Bytes.
  • Is the value changed: 1 Byte. (Y or N).
  • Old Value: …
  • New Value: …

Here, if the field is changed, both old and new values are stored. If a primary audited key field is not changed, only a single value is stored. For other audited fields, if the fields are not changed, nothing is stored. For all primary key audited fields and all other audited fields that are changed, these entries are made to make the audit-data.

For more information on audit rows and examples, see Audit server

  • Transaction status:

    Length: 1 byte. Transaction status can have these values:

    • COMMIT_DONE
    • ABORT_DONE
  • Number of audit rows in the transaction:

    Length: 2 bytes.

  • Total bytes of data of this transaction:

    Length: 4 bytes.