15.00 - IBM C - FastLoad

Teradata FastLoad Reference

prodname
FastLoad
vrm_release
15.00
category
Programming Reference
featnum
B035-2411-034K

IBM C

INMOD and notify exit routines written in IBM C must:

  • Contain the entry point name _dynamn
  • Be stored as an z/OS load library file
  • To create and use an IBM C INMOD or notify exit routine on z/OS

    1 Prepare the INMOD routine source file.

    2 Compile the INMOD routine.

    3 Link‑edit the INMOD program and store the results as an z/OS load library file.

    4 Invoke the Teradata FastLoad utility to execute the INMOD routine.

    Example  

    The INMOD routine in the following example reads the data from the input source and presents it, as read, to the Teradata FastLoad utility. BTEQ1 creates a table on the Teradata Database and BTEQ2 selects rows from the table to check for properly loaded data.

    This basic program can be modified to select records that meet a specified criteria, convert certain fields, or perform other preprocessing functions.

     
    //*   Compile and linkedit the INMOD                                   
    //******************************************************************
    //IBMCOMPL EXEC  LC370CL,ENTRY=DYNNR,PARM.C='DYNAMNDEF,OPTIMIZE'
    //C.SYSLIB  DD
    //          DD  DISP=SHR,DSN=<Your  macro library>
    //C.SYSIN   DD   *
     
     
    //******************************************************************
    //* Linkedit the INMOD                                            *
    //******************************************************************
    //LKED.SYSLMOD DD DISP=SHR,DSN=<Your load library>
    //LKED.SYSIN  DD *
       NAME MYINMOD(R)
    //**************************************************************** 
    //*        Execute BTEQ to create a Teradata DBS table           * 
    //*                                                              * 
    //* The BTEQ statement .run ddname=logon allows the user to      * 
    //* place sensitive logon information in a secure data set (in   * 
    //* this case, the ddname is logon).  Logging on from a data     * 
    //* set prevents this sensitive information from appearing in    * 
    //*the SYSIN file.                                               * 
    //**************************************************************** 
    //BTEQ1  EXEC TDSBTEQ 
    //LOGON  DD  DSN=JLH.CNTL(JLHLOGON),DISP=SHR 
    //SYSIN  DD  DATA,DLM=##
     .run ddname=logon 
     drop table stuff; 
     drop table stuff_error1; 
     drop table stuff_error2; 
     create table stuff (t1 char(40), t2 char(40)) 
     primary index(t1); 
     .quit
    ## 
    //* 
    //* 
     
    //FAST  EXEC  TDSFAST 
    //FASTLOAD.STEPLIB DD                                                   
    //                 DD                                                   
    //                 DD  DISP=SHR,DSN=<your load library>                 
    //FASTLOAD.SYSIN   DD  DATA,DLM=$$                                      
    LOGON <Logon userid and password>
    BEGIN LOADING stuff ERRORFILES stuff_error1,stuff_error2; 
    DEFINE t1 (char(40)),
          t2 (char(40)) 
          INMOD=MYINMOD;
    INSERT INTO stuff (:t1,:t2); 
    END LOADING; 
    logoff; 
    $$ 
    //FASTLOAD.EXPORT  DD DSN=JLH.STUFF.DATA,DISP=SHR 
    //* 
    //**************************************************************** 
    //*    Using BTEQ, select the rows loaded by FastLoad            * 
    //**************************************************************** 
    //BTEQ2    EXEC TDSBTEQ 
    //LOGON    DD DSN=JLH.CNTL(JLHLOGON),DISP=SHR 
    //SYSIN  DD  DATA,DLM=##
     .run ddname=logon 
     select * from stuff order by 1; 
     .quit