Page 1 of 1

Create C++ routines in windows

Posted: Thu Sep 09, 2010 12:57 am
by prasson_ibm
Hi All,

I have installed datastage 7.5 in my laptop and also installed .net 2003.Here i have created c++ routines and i want to call it in transformer.For that i need to generate object file.But i dont know how to create that object file in windows.

Can anyone help me.


Thanks

Posted: Thu Sep 09, 2010 9:25 am
by prasson_ibm
Hi,

Can anyone help me in this topic..??

Posted: Thu Sep 09, 2010 9:37 am
by chulett
Windows or UNIX, doesn't really matter, the compiler would function the same way in either environment. I don't know the gory details, but an exact search for object file returned 130 matches, something in there should help answer your question.

Posted: Fri Sep 10, 2010 2:52 am
by varunndschange
thanks for your detailed sincere explanation and patience, it is really useful :D

Posted: Tue Sep 14, 2010 11:33 am
by prasson_ibm
Hi
With the help of mike's post i an finally able to complile the routine,but its not working properly in transformer.
my code is :-

Code: Select all

#include<conio.h>
#include<stdlib.h>
int sum(int a,int b)
{
int c;
c=a+b;
return c;
}
When i am compiling its giving following warning :-
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\stdlib.h(185) : warning C4005: 'errno' : macro redefinition
C:\Program Files\MKS Toolkit\include\nutc\errno.h(32) : see previous definition of 'errno'c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\stdlib.h(428) : warning C4005: 'sys_errlist' : macro redefinition
Object file is created & i copied this file to C:\Ascential\DataStage\PXEngine\lib path but while calling the routine in Transformer its giving below error message:-

Code: Select all

##I TOSH 000002 22:55:21(001) <main_program> orchgeneral: loaded
##I TOSH 000002 22:55:21(002) <main_program> orchsort: loaded
##I TOSH 000002 22:55:21(003) <main_program> orchstats: loaded
##W TFPA 000012 22:55:21(006) <main_program> Warning: the PWD environment variable is not defined. Remote process startup may be unsuccessful as a result.If your ORCHESTRATE job does not start up correctly, please set your PWD variable to a value that will work on all nodes of your system.
##E TBLD 000000 22:55:24(000) <main_program> Error when checking composite operator: Subprocess command failed with exit status 40192
##E TFSR 000019 22:55:24(001) <main_program> Could not check all operators because of previous error(s)
##W TFCP 000000 22:55:24(002) <transform> Error when checking composite operator:  The number of reject datasets "0"is less than the number of input datasets "1".
##I TBLD 000000 22:55:24(003) <main_program> Error when checking composite operator: Output from subprocess: C:\Ascential\DataStage\Projects\Training\RT_BP94.O\V0S1_Test_Routine_Transformer_1.C(237) : warning C4244: '=' : conversion from 'APT_Int64' to 'int', possible loss of data

##I TFCP 000008 22:55:24(004) <transform> Error when checking composite operator: cxx    -LC:/Ascential/DataStage/Projects/Training/RT_BP94.O/ -LC:/Ascential/DataStage/PXEngine/lib -LC:/Ascential/DataStage/PXEngine/user_lib -W/TP -W/dll -W/base:0x50000000 -lliborchnt -lliborchcorent -lliborchbuildopnt C:\Ascential\DataStage\PXEngine\lib\SUM.o C:/Ascential/DataStage/Projects/Training/RT_BP94.O/V0S1_Test_Routine_Transformer_1.tmp.o -o C:/Ascential/DataStage/Projects/Training/RT_BP94.O/V0S1_Test_Routine_Transformer_1.dll
##I TBLD 000000 22:55:24(005) <main_program> Error when checking composite operator: Output from subprocess: LINK : warning LNK4224: /DEBUGTYPE:BOTH is no longer supported;  ignored
LINK : fatal error LNK1181: cannot open input file 'C:AscentialDataStagePXEnginelibSUM.o'

##E TCOS 000029 22:55:24(006) <main_program> Creation of step finished with status = FAILED (Test_Routine.Transformer_1)

*** Internal Generated Transformer Code follows:
0001: //
0002: // Generated file to implement the V0S1_repos_Transformer_1 transform operator.
0003: //
0004: 
0005: // define external functions used
0006: extern int32 sum(int32 A,int32 B);
0007: 
0008: // define our input/output link names
0009: inputname 0 DSLink3;
0010: outputname 0 DSLink4;
0011: 
0012: initialize {
0013: 	// define our row rejected variable
0014: 	int8 RowRejected0;
0015: 
0016: 	// define our null set variable
0017: 	int8 NullSetVar0;
0018: 
0019: }
0020: 
0021: mainloop {
0022: 	// initialise our row rejected variable
0023: 	RowRejected0 = 1;
0024: 
0025: 	// evaluate columns (no constraints) for link: DSLink4
0026: 	DSLink4.A = sum(DSLink3.A , DSLink3.B);
0027: 	writerecord 0;
0028: 	RowRejected0 = 0;
0029: }
0030: 
0031: finish {
0032: }
0033: 
*** End of Internal Generated Transformer Code
I cant understand what is issue now.

Can anyone help me.

Thanks

Posted: Tue Sep 14, 2010 10:57 pm
by prasson_ibm
Hi All,

Can anyone help me to resovle above mentioned issue.....

Posted: Wed Sep 15, 2010 12:24 am
by ray.wurlod
1. Is the same macro defined in both your header files? If so you'll need to figure out a way around that.

2. Set PWD to a single dot (current working directory).

3. The "number of datasets" error is sometimes spuriously thrown when the compiler license has expired. This is something else you might check.