Extracting Fields Based on End Criteria

Typically, field information is extracted by picking up a specific number of characters (in impact, DJDE, AFP mixed, or AFP line print streams) or by picking up text until the length parameter value is met or an AFP code or Metacode occurs (in AFPDS, AFP mixed, or Metacode print streams). You may need to pick up data that contains AFP codes or Metacode commands or that occurs before a specific string, or you may need to pick up data until the end of a record. In such cases, AFP codes or Metacode commands that occur within the data to be picked up must be removed so the data can be used for sorting, address cleansing, and so on.

The Field group <TEXTUNTIL> tag enables you to pick up field information until a specific condition is met or until the <LOCATION> tag length parameter value is met. Each AFP code or Metacode within the extracted field information is treated as a single space in the text. <TEXTUNTIL> tag syntax is:

<TEXTUNTIL> type [value units]

The type parameter specifies when Enrichment should stop picking up field information (that is, when it should stop reading hexadecimal codes or Metacode commands as spaces, thus ending the field information). For information on the valid type parameter settings, see the Enrichment Language Reference Guide.

Note: Do not specify value if you set the <TEXTUNTIL> tag type value to RECORD or TEXT.
The value parameter defines a specific point at which Enrichment should stop picking up field information.
  • If you set type to X, XR, Y, or YR, value specifies a size in units. If Enrichment encounters a move of this size or greater, it stops picking up field information.
  • If you leave value blank for type X, XR, Y, or YR, Enrichment stops picking up field information at the first move encountered.
  • If you set type to STRING, value specifies the string at which Enrichment should stop picking up field information. If the string contains spaces, you must enclose it in single or double quotation marks.

The units parameter defines the units in which the value you specified is set. Use the units parameter only if you set type to X, XR, Y, or YR.

When you use the <TEXTUNTIL> tag, Enrichment counts each hexadecimal code or Metacode in field information as a space, up to the limit specified in the tag or until the field information reaches the length specified in the <LOCATION> tag.

For example, to pick up the city, state, and ZIP Code™ information from the AFP mixed record shown below for address cleansing, you would specify <TEXTUNTIL> X in the Field group.

K0DLexington,0C01KY0C010F0405030C01K
KCB          4508  450E316     473AK

For this example, <TEXTUNTIL> X specifies that Enrichment should stop picking up data when it encounters an absolute x move in that data. Therefore, Enrichment stops picking up data at X'04C7031A'. Enrichment reads intervening AFP codes (X'04C50018', X'04C5001E' and X'03F106') as spaces, so the field information is:

Lexington, KY 40503