You can create index tags in these ways:
- You can create an index tag for a block of text that occurs in a consistent location on the same page in every page group, on a supplemental page, or on an individual page in a page group. For example, you can create an index tag for a block of text that contains a customer name or an account number. You can edit the text value to remove unwanted text such as blanks or special characters.
- You can create an index area that occurs in a consistent location on the same page in every page group or supplemental page and create index tags within the area. Within an index area, you can create index tags that span multiple text blocks on the same line. For example, if one text block on a line contains the first half of an account number and the next text block on the line contains the second half of the account number, you can concatenate the values in the text blocks and create one index tag that spans both blocks of text.
- You can create index tags for an address area in a page group or supplemental page. An address area is useful when you want to index mailing addresses that can contain a different number of lines in each page group. For example, the address in one page group might contain four lines, while the address in another page group might contain five lines. Within an address area, you can do specialized functions that apply to addresses. For example, you can create an index tag for a ZIP Code in the U.S. Postal Service format (nnnnn or nnnnn-nnnn) that occurs on the last line of the address area (or on a line relative to the last line).
- You can create index tags for No Operation (NOP) records. A NOP record causes an application to move to the next instruction for processing without taking any other action. NOP records can be found anywhere in a page group–either on a page in the page group or outside the logical AFP pages. NOP records in the AFP file are not viewable or printable, but you can create index tags from the data contained in them. You can create index tags for NOP records that are in the same position in all page groups, but outside a page, or you can create index tags for specific NOP records that are in any location in the page groups–on a page or outside a page.
For example, a bank-statement application produces a file with hundreds of individual customer statements. Each statement has the same general format, although statements might vary in size or number of pages. Each statement contains the page number, an account number, a date, and the customer's address. After you use AFP Indexer mode to create page groups and define supplemental pages, you create an index tag for the account number and another index tag for the date so that when you view production AFP files, you can display a particular statement based on the account number or date. You might create additional index tags for values in the customer address, such as the ZIP Code, so that you can sort statements (documents) according to ZIP Code before printing. You can use AFP Editor mode to create barcodes that contain the ZIP Code.
If the AFP file is already indexed, you can add new index tags to use with the existing page groups and supplemental pages. You can also update an existing control file for an AFP file and add new index tags to the existing ones.
To create more types of index tags than the control file allows, you can use exits. You can import a user exit to modify existing index tags or to add new index tags. For example, you might want to change the index tag of the customer number to include a 3-character prefix. Or, you might need custom code to create an index tag for information that is not at a consistent location in the page group.