Inmod Compilation on Windows or Unix for FastLoad

Tools
Enthusiast

Inmod Compilation on Windows or Unix for FastLoad

Hi Gurus,

I got an inmod for processing one feed file and eliminate some unwanted rows and then feed the records to fastload. But I am not able to compile it and use it. I have GCC (GNU C Compiler) and TCC (Tiny C Compiler) on my windows macine and I got Fastload utility also installed. I tried to compile the code into a DLL and I succeded in that using below commands.

gcc -c mydll.c
gcc -shared -o mydll.dll mydll.o

But I don't know whats next....

Do I have to compile it in a separate way and Do I need to link it to fastload somewhere?

I also have a unix machine installed with Fastload and GCC. So if you have ever done inmod setup on unix please share the same?

Thanks in advance.
3 REPLIES
Teradata Employee

Re: Inmod Compilation on Windows or Unix for FastLoad

First, I will say that it may not be guaranteed that source code compiled with GCC or TCC will work on Windows.

However, assuming that the code was written, compiled and linked correctly and the binaries created will work with the FastLoad executable, the only thing you need to do is to provide the name of the INMOD in the FastLoad script.

This is documented in the FastLoad manual.

INMODs are specified in the DEFINE statement as:

DEFINE
.
.
.
INMOD=;

You must also make sure that the entry point for the INMOD (in your source code) *MUST* be BLKEXIT.

If you need assistance with the C code structure, please see the sample INMODs we ship with FastLoad.

INMODs are also discussed in the FastLoad reference manual.
-- SteveF
Enthusiast

Re: Inmod Compilation on Windows or Unix for FastLoad

@feinholz: Thanks for your response. I have got my C Inmod Code written by some teradata guys. And it is having BLKEXIT as the entry point and we checked every thing in the C code. Our main concern was is my way of compiling it correct and should I link them or place them in some folder so that Fastload will access them.

For example: I have tried putting the output .dll and .o files in C:\Program Files\NCR\Teradata Client\FastLoad

Let me try out different ways possible and I will come back with the test results. Also if possible please give us any suitable compiler with which I should compile the code and where can I get that(if possible). Thanks again.
Enthusiast

Re: Inmod Compilation on Windows or Unix for FastLoad

One of the most common problems with inmods in windows platform is that the users do not mention the declspec + dllexport specification in blkexit function of the inmod source. So, make sure it is specified in the inmod source, if it already is not there.

You can specify the full path name of the inmod in the DEFINE..INMOD specification. Like

DEFINE
:
:
INMOD='c:\temp\yourinmod.dll';

Suitable compiler: Visual C++.