Chapter 11. Exits 245
A good use of this program is for an application that must pull an index from a source other 
than the document. The application group can be set up with a default index; then, the user 
exit program can grab the appropriate index from this secondary source and replace the 
default value that was in the index record. The record is then sent back to ACIF . 
Another example is to modify the format of an existing index. Example 11-1 shows a sample 
index exit C program to update the date format from mmddyy to mm/dd/yy. 
Example 11-1   Sample ACIF index exit program
#define _c_APKIND
/*********************************************************************/
/*                                                                   */
/* MODULE NAME: UPDDATE.C                                            */
/*                                                                   */
/* SYNOPSIS: ACIF Sample Index Exit                                 */
/*                                                                   */
/*                                                                   */
/* DESCRIPTION: This module converts the date format                */
/*               from mmddyy to mm/dd/yy before adding the           */
/*               record to the index object file                     */
/*                                                                   */
/*********************************************************************/
#include "apkexits.h"/* standard acif exit header file */
long
INDXEXIT( INDXEXIT_PARMS *exitstruc )
{
   int i;
   if ( exitstruc->eof != IDX_EOFLAG )
     {
/************************************************/
/* Look for TLE with attribute name "mmddyy"    */
/************************************************/
     if (
         (exitstruc->record[13] == 0x6D) &&
         (exitstruc->record[14] == 0x6D) &&
         (exitstruc->record[15] == 0x64) &&
         (exitstruc->record[16] == 0x64) &&
         (exitstruc->record[17] == 0x79) &&
         (exitstruc->record[18] == 0x79))
       {
/************************************************/
/* TLE length is now 40 (was 38)                */
/************************************************/
       exitstruc->record[ 2] = 0x28;
/************************************************/
/* Attribute value count is now 12 (was 10)     */
/************************************************/
       exitstruc->record[19] = 0x0C;
Important: The ACIF index file is in AFP format. It is important to understand the structure 
of AFP before you write or modify an index exit.