Basic Transformer in Parallel job

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Did you create a "parallel routine" (an interlude to your function) in the Repository?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Suman
Participant
Posts: 53
Joined: Thu Oct 07, 2004 8:28 am

Post by Suman »

The C program is compiled with +z option.A parallel routine is also present in repository. Do I need to use any function inside the C program or only using main() is sufficient.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

A parallel routine (a C function) does NOT have a main() entrypoint.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Suman
Participant
Posts: 53
Joined: Thu Oct 07, 2004 8:28 am

Post by Suman »

ray.wurlod wrote:A parallel routine (a C function) does NOT have a main() entrypoint. ...
If I am correct you mean main() is not required and separate function name is required in C.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Yes. You are correct. Its just a function. You can have a main and do the testing from command line, but once all the testing is done, you need to remove the main() function. Also make sure that no input arguments of the C function are defined as const. It does not work with datastage.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Suman
Participant
Posts: 53
Joined: Thu Oct 07, 2004 8:28 am

Post by Suman »

DSguru2B wrote:Yes. You are correct. Its just a function. You can have a main and do the testing from command line, but once all the testing is done, you need to remove the main() function. Also make sure that no input arguments of the C function are defined as const. It does not work with datastage.
I have made the changes in C program without main() funtion. Still I am getting the below error during compilation in transformer:
ld: Can't find library or mismatched ABI for -lorchhpia64

The server is HP-UX.

Suman
Suman
Participant
Posts: 53
Joined: Thu Oct 07, 2004 8:28 am

Post by Suman »

Suman wrote:
DSguru2B wrote:Yes. You are correct. Its just a function. You can have a main and do the testing from command line, but once all the testing is done, you need to remove the main() function. Also make sure that no input arguments of the C function are defined as const. It does not work with datastage.
I have made the changes in C program without main() funtion. Still I am getting the below error during compilation in transformer:
ld: Can't find library or mismatched ABI for -lorchhpia64

The server is HP-UX.

Suman
I am now able to compile and link the job with the following options:
aCC +DD64 -O -c -ext -z +Z test.c
aCC +DD64 -b -Wl,+s -Wl,+vnocompatwarnings test.o

But in the C program I am using file funtions of C like fgets(),fopen() etc. In the C function I am passing char* as an argument. In unix side the program is working fine and giving a correct return value but in datastage it is always giving -1 as return value.

Are the file funtions not recognized by datastage or I need to change something.Please help me with this.

Suman
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

WHile setting up the parallel routine via DataStage, what 'Type' did you provide as the input variables? It should be defined as char*.
But now that i re-read your question, you are saying that its 'return' value is getting messed up, the return value will depend upon your input. Maybe your not handling that input, it could be null. fget(), fopen() are standard commands for the stdio library which you include in your program. That should/will not make a difference.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Suman
Participant
Posts: 53
Joined: Thu Oct 07, 2004 8:28 am

Post by Suman »

I am able to run my C program after changing the file name in the program with the full path. I was not using this forum for a while and I am back now.Thanks to all of you.

Suman
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Glad you came back with the solution, it will help others in the future. :)
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply