Generate a C OUTMOD Routine - FastExport

Teradata® FastExport Reference

Product
FastExport
Release Number
16.20
Published
September 2020
Language
English (United States)
Last Update
2020-09-11
dita:mapPath
lki1527114222329.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
B035-2410
lifecycle
previous
Product Category
Teradata Tools and Utilities

Following is the listing of the feomod.c sample OUTMOD routine that is provided with the FastExport utility software:

   #include <stdio.h>
   #include <stdlib.h>
   /**********************************************************************/
   /*                                                                    */
   /* feomod.c   - Sample Outmod for FastExport.                         */
   /*                                                                    */
   /* Purpose    - This outmod deletes the data passed to it.            */
   /*                                                                    */
   /* Execute    - Build Outmod on a UNIX operating system               */
   /*                compile and link into shared object                 */
   /*                    cc -G feomod.c - o feomod.so                    */
   /*                                                                    */
   /*            - Build Outmod on a Win32 system                        */
   /*                compile and link into dynamic link library          */
   /*                    cl /DWIN32 /LD feomod.c                         */
   /*                                                                    */
   /*  Copyright (C) 1996-2012 by Teradata Corporation.                  */
   /*  All Rights Reserved.                                              */
   /*  Teradata Corporation CONFIDENTIAL AND TRADE SECRET                */
   /*                                                                    */
   /**********************************************************************/                        
   typedef unsigned short     Int16;
   typedef unsigned char      Int8;
   typedef unsigned int UInt32;
   #ifdef WIN32 /* Change for WIN32 */
   __declspec(dllexport) UInt32 _dynamn( int *code,
                                         int *stmno,
                                         int *InLen,
                                         char *InBuf,
                                         int *OutLen,
                                         char *OutBuf
                                   )
#else
UInt32 _dynamn(code, stmno, InLen, InBuf, OutLen, OutBuf)
   int     *code;
   int     *stmno;
   int     *InLen;
   char    *InBuf;
   int     *OutLen;
   char    *OutBuf;
   #endif

   
   {
   /* case on entry code
   */
   switch (*code) {                                                                                
    case 1:  /* Initialization, no other values */
      printf ("OUTMOD Initial Entry\n");
      break;
    case 2:  /* Cleanup call, no other values */
      printf ("OUTMOD End of Responses Entry\n");
      break;
    case 3:  /* Process response record */
      *InLen=0;
      *OutLen=0;
      break;
    case 4:
      /* Checkpoint, no other values */
      printf ("OUTMOD Checkpoint Entry\n");
      break;
    case 5:
      /* DBC restart - close and reopen the output files */
      printf ("OUTMOD DBC Restart Entry\n");
      break;
    case 6:
      /* Host restart  */
      printf ("OUTMOD Host Restart Entry\n");
      break;
    default:
      printf ("OUTMOD Invalid Entry code\n");
      break;                                                                                      
     }
    return (0);
   }