Specify Custom Fields in the Transaction Log File

$log_field fieldname [N|R]fieldwidth

This command allows you to add extra log-file fields DATA1 through DATA9. Data fields 1 through 4 are predefined (see Appendix E: Transaction Log), but you may use this command to change them to numeric format.

The parameters on this command are used as follows:

fieldname one of the keywords DATA1 .. DATA9. You must specify fields 5 and above in sequence, with no gaps. For example you cannot just specify field DATA6 without having defined field DATA5.
fieldwidth the width of the field, preceded by N to create a numeric field, or R to use the rightmost part of the field content, if too long. For fields 1 to 4, the width value is ignored. Numeric fields have no decimal places.
When you use this command, the new log file format will not be used until the next daily log file is created, but different format records in the same file may make the file invalid. Therefore to have immediate feedback of your changes you should rename or delete any log file already created for today and allow the system to create a fresh one.

As with fields DATA1 to DATA4, you may assign values to any DATAx variable using $set_var. If multiple DATAx $set_var assignments occur in the same .IIF file, all the values will be in the same log record. If you assign values in separate .IIF files, separate log records will be written. All these log records have code 'D' in the fourth flag position. The additional fields follow DATA4 in the record layout. If you specify a numeric format, it is your responsibility to assign to the field a variable value which can be converted to a number.

If you need more than five additional fields, we recommend using one of the DATAx fields as a record type code, and writing multiple records, reusing the other data fields for different data in each record. The maximum width of a data field is 254 characters.

Non-numeric fields are normally truncated on the right if the field length is smaller than the data size.  To use the rightmost part of the field instead, and truncate on the left, use a prefix letter of R.  Note that alphanumeric data fields shorter than the field length are always left-justified in the field, even with an R prefix.

Default: none (optional feature)

Examples:

$log_field DATA5 R20

$log_field DATA6 10

$log_field DATA7 32

$log_field DATA3 N

$log_field DATA4 N

See also this Example topic for further examples.