APKOUT.c exit snippet:
#include "apkexits.h"
long ACIF_EXPORT OUTEXIT( OUTEXIT_PARMS *exitstruc)
{
if(exitstruc->eof != OUT_EOFLAG)
{
exitstruc->request = OUT_USE;
if (!memcmp(exitstruc->record, " $$$TRIGGER1",12))
{
exitstruc->request = OUT_DELETE;
}
if (!memcmp(exitstruc->record, "1$$$TRIGGER1",12))
{
exitstruc->request = OUT_DELETE;
}
if (!memcmp(exitstruc->record, "$$$TRIGGER1",11))
{
exitstruc->request = OUT_DELETE;
}
}
return( 0 );
}
INCOMING Datastream (an earlier filtering process actually injects these lines to the delivered object):
$$$TRIGGER1,FORM=1064
$$$TRIGGER1,GRP=CUSTCORR01
$$$TRIGGER1,APP=PRINTFILES
$$$TRIGGER1,JOB=I0045
$$$TRIGGER1,FTYPE=F05
$$$TRIGGER1,PROGRAMID=I00108
$$$TRIGGER1,DSN=I00459.FORM1064
$$$TRIGGER1,AUTOPRINT=Y
..... rest of data from here is what is seen by the user on viewing the object
The OUT_DELETE entry expunges the line from the stream so it is never loaded with the object, but the indexer does see these lines for pulling indexing values.
Notes:
-The above items are used in the indexing parms of the App. Thus it finds the values in these lines.
-Make sure the indexer properties specify the fully qualified location of the apkout executable. I put it in /usr/local/bin, so the entry for this would read: /usr/local/bin/apkout
-You will need to have the xlc compiler available to build the apkout executable
apkout Makefile (I hacked up the original supplied):
CC = xlc
CDEBUGFLAGS = -O
DEFINES = -DAIX
COMPATFLAGS =
LOADFLAGS = -lc -H512 -T512
ARS_DIR = /usr/lpp/ars/lib
ICU_LIBS = $(ARS_DIR)/libicuuc30.a $(ARS_DIR)/libicudata30.a $(ARS_DIR)/libicui18n30.a
ICU_INC = -I/usr/icu4c/include
CFLAGS = $(CDEBUGFLAGS) $(DEFINES) $(COMPATFLAGS) $(LOADFLAGS)
TARGETS = apkout
all: $(TARGETS)
apkout: apkout.c apkexits.h
$(CC) $(CFLAGS) -o $@ apkout.c -eOUTEXIT
clean:
rm -f $(TARGETS)
Any questions, let me know.
-walt