Hi,
I have a java code with name Sum.java
code:-
class Sum1
{
int RetSum(int a1 , int a2)
{
return a1+a2;
}
}
class Sum
{
public static void main(String args[])
{
Sum1 a=new Sum1();
System.out.println(a.RetSum(10,20));
}
}
when i coplied this code it generates two class files
Sum.class and Sum1.class
I want to call this code in transformer.
Is it possible to do this,if it is please help me how to do ..??
Regards
Call java code in datastage
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 536
- Joined: Thu Oct 11, 2007 1:48 am
- Location: Bangalore
-
- Premium Member
- Posts: 536
- Joined: Thu Oct 11, 2007 1:48 am
- Location: Bangalore
Hi Chulett Thanks for ur reply,Ok but i dont know how to use buildup stage,can u please help me writing this code in buildup stage and exec..???chulett wrote:It's not as far as I know. There is a Java PACK that will allow you to do things like this but it is a option you need to purchase. Perhaps with a build-op?
1. Write a c program. Here's one I use:
2. Compile the code, on AIX I use "/usr/vacpp/bin/xlC_r -O -c HelloWorld.cpp"
3. Link the code, on AIX I use "/usr/vacpp/bin/xlC_r -O -G HelloWorld.o -o HelloWorld.o"
4. In the designer, create a parallel routine. Define it with the correct entrypoint (AwHelloWorld), as an object and with the correct parameter(s) and return type. Also use the correct full path to the HelloWorld.o file.
5. Create a job with a transform stage and call up the routine.
6. Bob's your uncle![Smile :)](./images/smilies/icon_smile.gif)
Code: Select all
#include <stdlib.h>
#include <stdio.h>
char * AwHelloWorld(char * InString)
{
char* OutStr;
OutStr="Hello World!";
return OutStr;
}
3. Link the code, on AIX I use "/usr/vacpp/bin/xlC_r -O -G HelloWorld.o -o HelloWorld.o"
4. In the designer, create a parallel routine. Define it with the correct entrypoint (AwHelloWorld), as an object and with the correct parameter(s) and return type. Also use the correct full path to the HelloWorld.o file.
5. Create a job with a transform stage and call up the routine.
6. Bob's your uncle
![Smile :)](./images/smilies/icon_smile.gif)