Many thanks for visiting my Blog..!!Please share this blog using below share buttons and leave your Comments/Feedback/Appreciations on Tab: Feedback
Share This Blog..!!

Datastage C/C++ Compiler issue on Windows Machine

Datastage C/C++ Compiler/Transformer Jobs Not Compiling: DK®

This post will help you to solve your Compilations Error when compiling a transformer based jobs (solution for Windows server machine). DK®
 *** Error when compiling a transformer (solution for Windows server machine) :  DK®

DataStage requires C++ compiler to compile the transformer. So if you have installed DataStage on a server and C++ compiler is not installed, you will get error in compiling. Given below is a portion of error –
<main_program> Error when checking composite operator: Subprocess command failed with exit status 256. [buildop\compile.C:646]
<main_program> Could not check all operators because of previous error(s) [api\step_rep.C:1186]
<transform> Error when checking composite operator: The number of reject datasets "0" is less than the number of input datasets "1". [transform\transform.C:2033]
<transform> Error when checking composite operator: cxx  -O   -IC:/IBM/InformationServer/Server/PXEngine/include -W/TP -W/EHa -DAPT_USE_ANSI_IOSTREAMS -c -W/Zc:wchar_t- C:/IBM/InformationServer/Server/Projects/dstage1/RT_BP2.O/V0S3_GenDataJob_Transformer_Transformer.C -o C:/IBM/InformationServer/Server/Projects/dstage1/RT_BP2.O/V0S3_GenDataJob_Transformer_Transformer.tmp.o.
<main_program> Error when checking composite operator: Output from subprocess: Compiler "cl" not found. DK®

To resolve this follow the below steps on a Windows server machine
 DK®
=========================================================================
1.    Install Visual Studio on Windows server. This will install the C++ compiler.

Only the VC++ and Visual Studio are required to be installed on the server. Other features are optional. For example, while installing on one machine only the following options of Visual Studio were selected – 

2.    Set the environment variables if required. Given below are the environment variables on one Windows machine which has Windows 7 OS. DK®
INCLUDE - C:\IBM\SQLLIB\INCLUDE;C:\IBM\SQLLIB\LIB
LIB - C:\IBM\SQLLIB\LIB
CLASSPATH - .;C:\IBM\SQLLIB\java\db2java.zip;C:\IBM\SQLLIB\java\db2jcc.jar;C:\IBM\SQLLIB\java\sqlj.zip;C:\IBM\SQLLIB\java\db2jcc_license_cu.jar;C:\IBM\SQLLIB\bin;C:\IBM\SQLLIB\java\common.jar
PATH - C:\IBM\InformationServer\Server\DSComponents\bin;C:\Program Files\MKS Toolkit\mksnt;C:\PROGRA~1\MKSTOO~1\bin;C:\PROGRA~1\MKSTOO~1\bin\X11;C:\PROGRA~1\MKSTOO~1\mksnt;C:\IBM\InformationServer\ASBNode\apps\jre\bin\classic;C:\IBM\InformationServer\ASBNode\lib\cpp;C:\IBM\InformationServer\ASBNode\apps\proxy\cpp\vc60\MT_dll\bin;%systemroot%\system32;%systemroot%;%systemroot%\system32\wbem;%systemroot%\system32\windowspowershell\v1.0\;c:\program files\ibm\gsk8\lib;C:\IBM\SQLLIB\BIN;C:\IBM\SQLLIB\FUNCTION;C:\IBM\SQLLIB\SAMPLES\REPL;C:\IBM\InformationServer\Server\DSEngine\bin;C:\IBM\InformationServer\Server\PXEngine\bin

VS80COMNTOOLS - C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\
OR
VS90COMNTOOLS - C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\

3.    Check that the compiler is installed correctly. For this, go to Start Menu à All Programs à Microsoft Visual Studio à Visual Studio Tools à Visual Studio Command Prompt
This will open a command prompt. Type cl.exe
Here is a sample result


4.    Now you need to set correct bit usage for C++ compiler using vcvarsall.bat file.
Again in Visual Studio command prompt (path shown in above point), run this command with respective argument

            vcvarsall.bat argument

This table shows the argument for your server – 
Vcvarsall.bat argument
Compiler
Host (either natively or using emulation)
Target architecture
"x86" (default)
32-bit Native
x86, x64, Itanium
x86
"x86_amd64"
x64 Cross
X86, x64, Itanium
x64
"x86_IPF"
Itanium Cross
X86, x64, Itanium
Itanium
"amd64"
x64 Native
x64
x64
"IPF" or "itanium"
Itanium Native
Itanium
Itanium

(If you need to know the details, check this link - https://msdn.microsoft.com/en-us/library/x4d2c09s%28v=vs.80%29.aspx)

To cross check which compiler is set, execute the following and the output would indicate.
    cl.exe

5.    Set the following Datastage ENV variable, from the Administrator client, to values below -
APT_COMPILEOPT : -W/TP -W/EHa -DAPT_USE_ANSI_IOSTREAMS -c -W/Zc:wchar_t- APT_LINKOPT : -s -W/dll -W/base:0x50000000 -W/Zc:wchar_t-

6.    Then restart the Datastage services.

The transformer should start working now.

No comments:

Post a Comment

disqus