- The exit must be named _dynamn
- Success is indicated by the return of a 0 (32-bit signed integer format)
- Failure is indicated by the return of a nonzero value (32-bit signed integer format). Use different integers to indicate different errors.
- The only parameter to the procedure is a pointer to a variable record structure.
- A C prototype example for an exit procedure might be as follows:
Int32 _dynamn(BTNotifyExitParm *P)
- The C structure that is passed to user exits by BTEQ for NOTIFY can be obtained from the notify header file btnfyext.h which is included in the BTEQ package. This header file is an API which must be used as-is by employing a preprocessor include directive to include its contents in site specific Notify Exit source files.
Since the data structures defined in this file are also used by BTEQ code, any mismatch in the definitions could lead to unexpected behavior. Make sure to use the same version of this header file which is distributed with the target BTEQ version.
- z/OS BTEQ can use both SAS/C compiled and IBM/C compiled Notify EXIT modules.
The following table summarizes how to build exit modules using different operating systems.
Operating System | Procedure |
---|---|
Sun Solaris | Compile the module with the following options: -K PIC -G. The resulting module is in shared library format. The exit must be specified using a filesystem path descriptor unless the environment variable LD_LIBRARY_PATH is set to point to the module at run time. BTEQ installs three files: a sample C file, the header file required by the sample C file, and a makefile. The respective files are located in the following locations:
To run the sample makefile, enter the following command: make -f mkbtnfyext.unx |
Red Hat Enterprise Linux | Compile the module with the following options: -m32 -fPIC -shared. The resulting module is in shared library format. The exit must be specified using a filesystem path descriptor unless the environment variable LD_LIBRARY_PATH is set to point to the module at run time. BTEQ installs three files: a sample C file, the header file required by the sample C file, and a makefile. The respective files are located in the following locations:
To run the sample makefile, enter the following command: make -f mkbtnfyext.linux |
z/Linux | Compile the module using the following options: -m31 -fPIC -shared
The resulting module is in shared library format. The exit must be specified using a filesystem path descriptor unless the environment variable LD_LIBRARY_PATH is set to point to the module at runtime. BTEQ installs three files: a sample C file, the header file required by the sample C file, and a makefile. The respective files are located in the following locations:
To run the sample makefile, enter the following command: make -f mkbtnfyext.suselinux-390.32 |
IBM AIX | Compile the module with the following option: -G
The resulting module is in shared library format. The exit must be specified using a file system path descriptor unless the environment variable LD_LIBRARY_PATH is set to point to the module at run time. BTEQ installs three files: a sample C file, the header file required by the sample C file, and a makefile. The respective files are located in the following locations:
To run the sample makefile, enter the following command: make -f mkbtnfyext.aix |
(ia64) Hewlett-Packard HP-UX | Compile the module with the following options: +u1 -D_REENTRANT +DD64
The resulting module is in shared library format. The exit must be specified using a file system path descriptor unless the environment variable LD_LIBRARY_PATH/SHLIB_PATH is set to point to the module at run time. BTEQ installs three files: a sample C file, the header file required by the sample C file, and a makefile. The respective files are located in the following locations:
To run the sample makefile, enter the following command: make-f mkbtnfyext.hpux-ia64 |
IBM z/OS | z/OS BTEQ installs two Notify EXIT files in the SAMPLIB PDS:
User-loadable Notify EXIT modules must exist in a load library whose location is identified in one of the DD names specified by the JOBLIB or STEPLIB in the JCL.
Using the SAS/C compiler:
Using the IBM/C compiler: Compile the Notify sample file using IBM/C (from USS) as follows: cc -o “//’<load_library>(<module_name>)’” -W c,dll,expo -W l,dll <filename> The resulting module is created as a DLL in the specified load library and is loadable by the IBM/C runtime. Example: cp “//’USER.SAMPLIB(BTNFYEXT)‘” btnfyext.h cp “//’USER.SAMPLIB(BTNFYXTC)‘” btnfyext.c cc -o “//’USER.LOAD(BTNFYEXT)’” -W c,dll,expo -W l,dll btnfyext.c For a sample JCL to build IBM/C Notify Exit load module using JCL, see z/OS Examples for NOTIFY. |
Microsoft Windows | A sample exit module makefile (btnfyext.mak) is included. Modify btnfyext.c as necessary and compile by issuing: nmake -f btnfyext.mak This produces btnfyext.dll. Copy the DLL to where bteq.exe resides c:\Program Files\Teradata\Client\<version>\Bin (by default). |
Apple OS X | Compile the module with the following options: -arch x86_64 -fPIC -shared
The resulting module is in shared library format. The exit must be specified using a file system path descriptor unless the environment variable DYLD_LIBRARY_PATH is set to point to the module at run time. BTEQ installs three files: a sample C file, the header file required by the sample C file, and a makefile. The respective files are located in the following locations: The respective files are located in:
where: %dest_root% is Library/Application Support/Teradata/Client/<version> To run the sample makefile, specify: make -f mkbtnfyext.macosx-x86_64 |