BrianAtWork
Programmer
Hello!
I am converting a DS Server job to a PX job, and the Server job uses 6 server routines. (We are using Datastage PX version 7.5) I wrote the routines in C and created new Parallel Routines to provide the same functionality. I am linking them as objects, not libraries.
5 out of the six work fine, but one of them will not work for me - here are the details.
The 5 routines that work take a 2 byte character string as input, perform a few if statements, and return a 2 byte character string.
I compiled and run the PX job to use the 5 new routines, and they work as expected.
Here is an example of one of them:
In the DS Routine definition, I defined one argument as char* and the return type as char*]
Now, for the 1 routine that won't work. The only difference is that the input to this routine is a 1 byte character, and the return is a 1 byte character. The c++ compiler has no problems when I compile the code, and Datastage has no problems when I compile the job. However, when I try to run the PX job, here is the abort message I get:
Here is the C code that I am using:
In the DS Routine definition I define the argument as char, and the return type as char. Then I read in the PX manual that if you define the return as char, the C code must declare the return as signed char. So I changed my code to this:
Now the job compiles and runs fine, but I don't get the right output from my routine. In one run I passed this routine a 'F' and the return from the routine was '8'...
Can anyone see my [probably obvious] mistake? The puzzling thing to me is that the job compiles just fine - but without the "signed" in front of the char declaration, the job aborts every time.
I've searched these forums for an answer but no one seems to have run into a problem like this that I have found.
Any help would be greatly appreciated.
Thanks in advance!
Brian
I am converting a DS Server job to a PX job, and the Server job uses 6 server routines. (We are using Datastage PX version 7.5) I wrote the routines in C and created new Parallel Routines to provide the same functionality. I am linking them as objects, not libraries.
5 out of the six work fine, but one of them will not work for me - here are the details.
The 5 routines that work take a 2 byte character string as input, perform a few if statements, and return a 2 byte character string.
I compiled and run the PX job to use the 5 new routines, and they work as expected.
Here is an example of one of them:
Code:
char *GetRelCd(char *inp){
char ans[2];
if(strcmp(inp,(char*)"00") == 0 ) {
sprintf(ans,"%s","EE");
}
else if(strcmp(inp,(char*)"01") == 0 ) {
sprintf(ans,"%s","SP");
else{
sprintf(ans,"%s","UN");
}
return ans;
}
Now, for the 1 routine that won't work. The only difference is that the input to this routine is a 1 byte character, and the return is a 1 byte character. The c++ compiler has no problems when I compile the code, and Datastage has no problems when I compile the job. However, when I try to run the PX job, here is the abort message I get:
Code:
Transformer_2: Failed to load the library "V0S2_BDH_CESTest_Transformer_2.o"; either the directory containing the library file
is not on the library search path, or the library was compiled on a system
that is incompatible with this system: Could not load "V0S2_BDH_CESTest_Transformer_2": rtld: 0712-001 Symbol CESGetCertCode__FSc was referenced
from module /dsadm/Ascential/DataStage/Projects/etlpx/RT_BP693.O/V0S2_BDH_CESTest_Transformer_2.o(), but a runtime definition
of the symbol was not found..
Here is the C code that I am using:
Code:
char CESGetCertCode(char inp){
char ans;
if (inp == 'F' || inp == 'R' || inp == 'S' || inp == 'U' || inp=='1' || inp == '2' || inp == '3' || inp == ' ') {
ans='D';
}
else{
ans='P';
}
return ans;
}
Code:
signed char CESGetCertCode(signed char inp){
signed char ans;
if (inp == 'F' || inp == 'R' || inp == 'S' || inp == 'U' || inp=='1' || inp == '2' || inp == '3' || inp == ' ') {
ans='D';
}
else{
ans='P';
}
return ans;
}
Can anyone see my [probably obvious] mistake? The puzzling thing to me is that the job compiles just fine - but without the "signed" in front of the char declaration, the job aborts every time.
I've searched these forums for an answer but no one seems to have run into a problem like this that I have found.
Any help would be greatly appreciated.
Thanks in advance!
Brian