Defining a Reference Field

When data does not appear in the same position on the printed page but is relative to another piece of unique data on the page, you can use the <REFERENCE> tag to define a reference point. The <REFERENCE> tag defines the following:
  • A carriage control that identifies records on which to search for the reference
  • Reference text for which to search
  • The start column of the text

For complete information, see the EngageOne™ Enrichment Language Reference Guide.

When you use a <REFERENCE> tag, EngageOne™ Enrichment automatically sets the location of the field information relative to the reference point. As the following figure shows, this adjusts <LOCATION> tag syntax so that the row value defines the vertical offset of the field information relative to the reference line or record. Likewise, the column value defines the horizontal offset of the field information relative to the end of the reference point.

Note: The <LOCATION> tag column value is always measured from the beginning of the last character of the reference point.

As this figure shows, set row to a negative number if the field information is the indicated number of lines or records above the reference record. Set row to 0 if the field information is on the reference record. Set row to a positive number if the field information is the indicated number of lines or records below the reference record.

Similarly, if you set the column parameter to a negative number, the field information begins that many characters before the beginning of the last character of the reference point, and so on.

For example, you might need to extract the account number from each bank statement you process. In the following figure, the location of the account number varies horizontally depending on the type of account and the number of transactions the customer has. The phrase Account Number: appears three spaces to the left of the account number, wherever it occurs on the page. The account number is always 12 characters in length. You could define a Field group as shown in the following figure to pick up the value.

<FIELD> %%Account_Number
    <REFERENCE> * 'Account Number:'
    <LOCATION> 0 3 12
</FIELD>

Since the account number does not occur with regularity on any specific record or line, the <REFERENCE> tag instructs EngageOne™ Enrichment to search on all records for Account Number:. The account number’s position can also vary from column to column, so no start parameter is specified on the <REFERENCE> tag.

The 0 after the <REFERENCE> tag indicates that the account number is on the same record as the phrase Account Number:. The 3 indicates that the account number begins on the third character position after the colon in Account Number:. Since the account number is 12 characters in length, the length parameter is set to 12.

Note: To set the value of the field to the reference string, set the <REFERENCE> tag as follows:

<LOCATION>0 -x y

where x = length -1 and y = length.