Adding an AFP Index to an Output

An AFP Index is a group of records added to the top of each document that can be used with IBM’s AFP Viewer, Large Mailing Operations (LMO) System, OnDemand, or other systems to identify the document and key information about it.

The layout and contents of the AFP Index are specified using the AFPIndex tag group within an Output tag group. The AFP Index groups all pages of a document within Begin Named Group (BNG) and End Named Group (ENG) structured fields. The contents of the AFP Index are the Tag Logical Element (TLE) structured fields placed at the top of each document.

You can add multiple TLE structured field records to each document by specifying multiple variables to include in the AFP Index. Each TLE record will contain:
  • The title of the data item
  • The system- or user-defined variable name

The AFPIndex tag group consists of three tags: <AFPINDEX> and </AFPINDEX>, which begin and end the tag group, and <PART>, which identifies a variable to include in the AFP Index. The <AFPINDEX> and </AFPINDEX> tags are required in the AFPIndex tag group, but they have no parameters.

The following shows a sample control file used to create an AFP Index that contains the customer name and page count for each document.
<input>
   <name> Bills                      <! Internal name for input file>
   <file> DD:INPUT1                  <! JCL name for input file     >
   <type> A                          <! Field to determine each     >
   <field> %%Customer_Name KA        <!  document and to index by   >
     <reference> ! 'Customer Name:'
     <location> 0 2 25
   </field>
   <doc> T %%Customer_Name C         <! New doc when name changes   >
</input>
<output>
   <name> IndexedOutput              <! Internal name for output    >
   <file> DD:OUTPUT1                 <! JCL name for output file    >
   <afpindex>                        <! Info to make into TLE record>
      <part> 'Customer Name:' %%Customer_Name 25<! User-defined val.>
      <part> 'Total Pages:' %%TOTAL_PAGES 8    <! System variable   >
   </afpindex>
</output>

Because you place the AFPIndex tag group within the Output tag group, the AFP Index only contains information about the documents written to a particular output.