Page 1 of 1

can we write routines in PX?

Posted: Fri Jan 09, 2009 12:14 pm
by sagar deshmukh
can we use routines in PX?

Posted: Fri Jan 09, 2009 12:31 pm
by chulett
I'm tempted to just say "yes", however... write or use? And of what routines do you speak of?

Posted: Fri Jan 09, 2009 2:13 pm
by sagar deshmukh
i mean can we use DS basic routines in PX or we need to write them in C++
not sure so wish to know.....

if yes...

Same routine which is used in server can be used in PX?

Posted: Fri Jan 09, 2009 2:38 pm
by chulett
Yes, Server BASIC routines can be used in a PX "BASIC Transformer" with all of the caveats they bring to the table. Or, better yet, write them in C++.

Posted: Fri Jan 09, 2009 3:47 pm
by ray.wurlod
Before/after job subroutines in parallel jobs are written in DataStage BASIC.

Routines callable from parallel Transformer stage must be written in C++ and compiled and linked, and have an entry in the Routines part of the Repository (a parallel "routine" is actually a description of the location of and arguments for the actual external object).

Routines callable from a BASIC Transformer stage are written in DataStage BASIC and may be the same ones that are used in server jobs.

Posted: Fri Jan 16, 2009 7:12 am
by sagar deshmukh
So aftter writting routine in C++ we need to copy it into the same DS compiler...
Also....Is there any need atall to routines......

Posted: Fri Jan 16, 2009 3:19 pm
by ray.wurlod
I detect some misunderstanding of how C (or C++) programming works. You don't "copy into a compiler". You use a compiler to convert your source code into something executable, and you use a linker to add references to any other libraries/objects that your code needs.

To use such a routine from a parallel Transformer stage, you need to create a "parallel routine definition" in the Repository. This is not the routine itself, but a piece of metadata that describes the location of the routine and the arguments (and their data types) that it requires.