Programming Considerations for Using Routines - FastExport

Teradata FastExport Reference

Release Number
English (United States)
Last Update
Product Category
Teradata Tools and Utilities

This section describes programming languages supported for each type of routine, as well as other related considerations.

Programming Languages

FastExport is written in:

  • IBM C for mainframe‑attached z/OS client systems
  • C for network‑attached UNIX and Windows client systems
  • In all cases, INMOD, OUTMOD, and notify exit routines are dynamically loaded at run time, rather than link edited into the FastExport module.

    INMOD, OUTMOD, and notify exit routines are written in the programming languages listed in Table 15. The routines are dependent on the platform which runs FastExport.


    Table 15: Languages Supported by Platform and Type of User‑Developed Routine 


    INMOD Routines

    OUTMOD Routines

    Notify Exit Routines


    Assembler, COBOL, PL/I, IBM C

    Assembler, COBOL, IBM C

    IBM C

    UNIX OS, Windows




    Note: Although it is neither certified nor supported, INMOD and OUTMOD routines can be written in COBOL on network‑attached client systems if the Micro Focus COBOL for UNIX compiler is used. However, it is strongly recommended that INMOD and OUTMOD routines be written in C/C++.

    Programming Structure

    Programming structures for INMOD, OUTMOD, and notify exit routines differ, as reflected in the following sections.

    Table 16 lists the programming language structures for communicating between FastExport and an INMOD routine.


    Table 16: Programming Structure for INMOD Routines 

    INMOD Routine Language

    Programming Structure


    First parameter:

    RBODY    DS   CL32004

    Second parameter:

    RSEQ     DS   F
    PLEN     DS   H
    PBODY    DS   CL100


    First parameter:

    struct {
             long Status;
             long RecordLength;
             char buffer[32004];

    Second parameter:

    struct {
             long  seqnum;
             short parmlen;
             char  parm[80];


    First parameter:

         03 RETURN-CODE PIC S9(9) COMP.
         03 RECORD-LENGTH PIC 9(9) COMP.
         03 RECORD-BODY PIC X(32004)

    Second parameter:

         03 SEQ-NUM PIC 9(9) COMP.
         03 PARM-LEN PIC 9(4) COMP.
         03 PARM-BODY PIC X(80).


    First parameter:

          10 STATUS FIXED BINARY(31,0)
          10 RLENGTH FIXED BINARY(31,0)
          10 REC CHAR(32004)

    Second parameter:

          10 SEQNUM FIXED BINARY(31,0)
          10 PLENGTH FIXED BINARY(15,0)
          10 PBODY CHAR(80)

    In each structure, the records must be constructed so that the left‑to‑right order of the data field corresponds to the order of the field names specified in the FastExport LAYOUT and subsequent FIELD and FILLER commands.

    The structure for communicating between FastExport and an OUTMOD routine uses the standard C calling conventions for the following parameters:

  • int *code;
  • int * stmtnum;
  • int *InLen;
  • char * InBuf;
  • int *OutLen;
  • char *OutBuf;
  • The structure for communicating between FastExport and a notify exit routine is a pointer to an FXNotifyExitParm structure, as shown in “Sample Notify Exit Routine” on page 171.

    Routine Entry Points

    Table 17 shows the entry points for INMOD, OUTMOD, and notify exit routines.


    Table 17: Entry Points for INMOD, OUTMOD, and Notify Exit Routines 

    Routine Language

    Entry Point

    IBM C on z/OS platform


    C on UNIX and Windows platforms,

    _dynamn (or BLKEXIT*)

    *Only for FDL‑compatible INMODs compiled and linked with BLKEXIT as the entry point. When the FDL‑compatible INMOD is used, ’USING("FDLINMOD")’ must be specified in the .IMPORT statement.

    COBOL and PL/I


    Working with Multiple Routines

    For each export task associated with a SELECT statement, the FastExport job can specify:

  • One INMOD routine with the IMPORT command
  • One OUTMOD routine with the EXPORT command
  • One notify exit routine with the BEGIN EXPORT command
  • A FastExport job can specify multiple export tasks, and each one can specify an INMOD routine, an OUTMOD routine, and a notify exit routine. (These specifications can be to the same or different routines.)

    Compiling and Linking Routines

    The methods for compiling and linking routines vary with the operating system. The following sections describe the methods for z/OS, UNIX OS, and Windows.

    For sample programs and procedures that compile and link INMOD, OUTMOD, and notify exit routines for the operating system environment, see Appendix C: “INMOD, OUTMOD, and Notify Exit Routine Examples.”

    On mainframe‑attached z/OS client systems, INMOD, OUTMOD, and notify exit routines must be compiled under IBM C.

    On network‑attached UNIX client systems, INMOD, OUTMOD, and notify exit routines must:

  • Be compiled with the native UNIX C compiler
  • Be linked into a shared object module
  • Use an entry point named _dynamn
  • On network‑attached Windows client systems, INMOD, OUTMOD, and notify exit routines must:

  • Be written in C
  • Have a dynamn entry point that is a __declspec
  • Be saved as a dynamic link library (DLL) file
  • Addressing Mode on z/OS Systems

    On FastExport 07.00 and later, use either 31‑bit or 24‑bit addressing for INMOD, OUTMOD, and notify exit routines on mainframe‑attached systems.

    The 31‑bit mode provides access to more memory, which enhances performance for FastExport jobs with a large number of sessions.

    Use the following linkage parameters to specify the addressing mode when building INMOD, OUTMOD, and notify exit routines for z/OS systems:

  • For 31‑bit addressing:
  •     AMODE(31) RMODE(24)
  • For 24‑bit addressing:
  •     AMODE(24) RMODE(24)