Skipping first few lines from one or more pages in IBMLINE report.

Previous topic - Next topic

pankaj.puranik

Hi

I am back after a long break. Was into some other stuff.

I have this requirement.
I have an input file which is to be indexed.
After indexing the output PDFs should not have first 3 lines in first page of each logical set that were there in input file.

Cheers
Pankaj.

Alessandro Perucchi

Hello Pankaj,

what do you mean with PDF? you have Text document (Ascii / AFP Line data) that you transform in PDF or do you have PDF and want to customize the output??

Sincerely yours,
Alessandro
Alessandro Perucchi

#Install #Migrations #Conversion #Educate #Repair #Upgrade #Migrate #Enhance #Optimize #AIX #Linux #Multiplatforms #DB2 #Windows #Oracle #TSM #Tivoli #Performance #Audits #Customizing #Availability #HA #DR #JavaApi #ContentNavigator #ICN #WEBi #ODWEK #Services #PDF #AFP #XML

pankaj.puranik

Ok let me elaborate.

I have an input report which is an IBMLINE file.
The first 3 lines contain the index data.

After the files are loaded into CMOD, I do not need these 3 lines.
So I want to remove then during loading or during retrieval, whichever is easier.

Forget about PDFs, I will extract data in the native format.

wwwalton

We do this alot having indexing values in the first n-lines (we imbed keywords prior) that the apkout exit looks for and suppresses the output of those lines into the load.
-walt

pankaj.puranik

Thanks Walt.
I see a sample code on IBM website to do this. But it just lists the parameters.
Do you have an actual example that you could share?
I have not worked with EXITS before so I do not know how it actually works and what you put in the C code.

typedef struct _OUTEXIT_PARMS /* Parameters for the output record exit       */
{
   char           *work;      /* Address of 16-byte static work area         */
   PFATTR         *pfattr;    /* Address of print file attribute information */
   char           *record;    /* Address of the record to be written         */
   unsigned short recordln;   /* Length of the output record                 */
   char           request;    /* Delete or process the record                */
   char           eof;        /* Last call indicator                         */
} OUTEXIT_PARMS;

wwwalton

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