Page 1 of 1

How to compile an enternal C/C++ Routine and use in DS PX

Posted: Tue Oct 18, 2005 4:36 am
by maffan76
Hi,
We have recently jumped from Server Version to PX and have to migrate jobs from Server verison to PX. While reading the Pdfs in my understanding that basic routines are no more usable in PX. So to acheive teh same funcationality we will have to write C/C++ functions and call it from transformer. I could not find any good example(s)/tutorial in any Pdf to how to build Parallel external routines on windows platform.

Can some guid me how to compile and link the routine in DS PX or any sample for it.

Thanks in Advance.

Posted: Tue Oct 18, 2005 3:54 pm
by ray.wurlod
Read the chapter on Custom Stages in the Parallel Job Developer's Guide.

Re: How to compile an enternal C/C++ Routine and use in DS P

Posted: Tue Oct 18, 2005 6:31 pm
by benny.lbs
You may refer to your DataStage Client installation disk in \Samples\TrxExternalFunctions\, it gives you a sample to build Parallel Transformer External Function.
maffan76 wrote:Hi,
We have recently jumped from Server Version to PX and have to migrate jobs from Server verison to PX. While reading the Pdfs in my understanding that basic routines are no more usable in PX. So to acheive teh same funcationality we will have to write C/C++ functions and call it from transformer. I could not find any good example(s)/tutorial in any Pdf to how to build Parallel external routines on windows platform.

Can some guid me how to compile and link the routine in DS PX or any sample for it.

Thanks in Advance.

Posted: Tue Oct 18, 2005 6:43 pm
by vmcburney
ray.wurlod wrote:Read the chapter on Custom Stages in the Parallel Job Developer's Guide.
Correction, look in the Parallel Job Advanced Developer's Guide.

Going to add this thread to my favourites. :lol:

You can also look in the old Orchestrate Guides as they have some more sample C code and are sometimes more complete then the DataStage guides. Ask Ascential Support for a copy.

Posted: Tue Oct 18, 2005 7:35 pm
by trammohan
here is the command for compiling external C/C++ routines in UNIX

aCC -c +z file_name

call this a.out from Datastage routine as external routine..

Ram

Posted: Tue Oct 18, 2005 7:46 pm
by vmcburney
I assume you want to replace your old DataStage BASIC routines with C functions. These functions can be called directly from a parallel transformer and the sample functions are a good place to start. It is written in a C language so you should find a good C reference book, I don't think Ascential have any documentation on these.

Posted: Wed Oct 19, 2005 12:51 am
by maffan76
Thanks everyone,
I did look into the Parallel Job Advanced Developer Guide but could nto find anything related to Parallel Routines. it does explain the Stage Type but no tutorial on Parallel Routines.

As far as the samples are concerned, no sample of windows :( and there are no exmaples of how to build parallel routines for Windows Platform as i am running 7.5x2 on windows XP (for sample dev) though i know the platform is not officially supported but the version runs on this with no problem, correct me if i am wrong.

Posted: Wed Oct 19, 2005 4:58 am
by Eric
Do you want to build static or dynamic libraries?

For static libraries you need to compile a *.lib file
for dynamic libraries you need to build a *.dll file

How you generate these depend on your choice of using command line 'nmake' or the Visual Studio .net application.

Posted: Wed Oct 19, 2005 4:12 pm
by ray.wurlod
Why would a C routine on Windows be any different from the same C routine on UNIX? Unless, of course, it interacts with the file system (pathnames are different) - but the whole goal of parallel jobs is to keep data in memory (virtual Data Sets) as much as possible.

Posted: Fri Oct 21, 2005 5:21 am
by Eric
ray.wurlod wrote:Why would a C routine on Windows be any different from the same C routine on UNIX?
The routine code may be the same, but to create a windows DLL you will require a different function decleration and sometimes different include definitions. This is due to the way the windows platform uses a DLL at runtime.

Posted: Wed Oct 26, 2005 12:24 pm
by clshore
Another caveat, my documentation (7.5) specified that a C++ compiler was required.
I have not tried (yet) on a Windows platform.

Carter

Re: How to compile an enternal C/C++ Routine and use in DS P

Posted: Wed Oct 26, 2005 9:24 pm
by vmcburney
[quote="maffan76"]Hi,
We have recently jumped from Server Version to PX and have to migrate jobs from Server verison to PX. quote]
And another thing, you don't have to migrate your jobs from server to PX. :twisted: You only need to migrate those jobs that need to run faster and would benefit from a parallel architecture. Since you already have a large investment in server jobs and server routines why migrate those that are working and working well? Server jobs and parallel jobs can live happily together. You may also find a parallel job with a server transformer gives you enough of a performance improvement.