Replacing Text
You can use the <FIELD> tag to direct Enrichment to take several actions on fields, including replacing text. Use the replace action (R) to update the print stream if the value of the associated field variable changes after it is extracted from the document. The variable value could be changed in a number of ways—such as through CASS address cleansing or by an assignment statement in the rules.
For example, if you want to change a field called %%Account_Number:
<FIELD> %%Account_Number R
The new %%Account_Number value will automatically replace the old value when the document is written.
Note that the coding above will affect only the first occurrence of %%Account_Number on the document. Setting the action parameter to RA will affect all fields located by that <FIELD> tag. To change all occurrences, use the following coding:
<FIELD> %%Account_Number RA
You can format the value of %%Account_Number in the rule file so that it prints out properly. Use the <REPLACE> tag within the Field group to specify whether the field location can “grow” or “shrink.” For information on the <REPLACE> tag, see the Enrichment Language Reference Guide. The following shows the coding to allow the account number to grow from 12 to 20 characters in length without overwriting other text.
<FIELD> %%Account_Number RA
<REFERENCE> K
<LOCATION> K
<REPLACE> 20 Y
</FIELD>