z/OS | IBM C INMOD Routine | Teradata FastLoad - 17.10 - IBM C - FastLoad

Teradata® FastLoad Reference

Product
FastLoad
Release Number
17.10
Published
June 2021
Last Update
2021-07-01
Content Type
Programming Reference
Publication ID
B035-2411-061K
Language
English (United States)
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

Creating and Using 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 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 link-edit the INMOD
//******************************************************************
//IBMCOMPL EXEC  LC370CL,ENTRY=DYNNR,PARM.C='DYNAMNDEF,OPTIMIZE'
//C.SYSLIB  DD
//          DD  DISP=SHR,DSN=<Your  macro library>
//C.SYSIN   DD   *


//******************************************************************
//* Link-edit 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