Import DS function in C++ Routine

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

Post Reply
ljulienne
Participant
Posts: 10
Joined: Tue Jun 09, 2009 3:14 am
Location: Lyon, FRANCE
Contact:

Import DS function in C++ Routine

Post by ljulienne »

Hi,

I would like to know if one of you already used datastage built-in functions in C++ routine for DS PX v8 and if it is possible (or not)

I have to migrate a routine from v7.5 Server to v8 PX and some function like Field, Trim, ... are used in the Server routine and to avoid to redevelop everything in C++, I would like reuse existing Datastage function.

If someone has some tips...

Thanks.

Laurent
Laurent JULIENNE
SYNCER
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

There's been no appreciable change in the DataStage built-in functions for Server between 7.5 and 8.1 The client I am at has hundreds of Basic routines and jobs that use the majority of the functions and the only change we saw was related to switching to NLS.
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

And I just implemented a c++ function in V8 today and it worked just as it has in the past.
ljulienne
Participant
Posts: 10
Joined: Tue Jun 09, 2009 3:14 am
Location: Lyon, FRANCE
Contact:

Post by ljulienne »

ArndW wrote:And I just implemented a c++ function in V8 today and it worked just as it has in the past. ...
ok, so could you tell me what is the syntax to integrate in C++ script, the datastage functions because I use the NullToValue function for example and I got an error message from the compiler.
`NullToValue' was not declared in this scope

So I guess I have to declare it but I don't know how in fact.
Laurent JULIENNE
SYNCER
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Once I get back to work I can get the list of include files and functions that you need
ljulienne
Participant
Posts: 10
Joined: Tue Jun 09, 2009 3:14 am
Location: Lyon, FRANCE
Contact:

Post by ljulienne »

ArndW wrote:Once I get back to work I can get the list of include files and functions that you need ...
Thanks ArndW.
Laurent JULIENNE
SYNCER
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I just checked - the c++ function doesn't use any API calls, and the other object is a buildop which uses a whole different set of calls.
ljulienne
Participant
Posts: 10
Joined: Tue Jun 09, 2009 3:14 am
Location: Lyon, FRANCE
Contact:

Post by ljulienne »

ArndW wrote:I just checked - the c++ function doesn't use any API calls, and the other object is a buildop which uses a whole different set of calls. ...
OK, so it seems there is no alternative way than to redevelop DS function equivalent in C++.

Anyway, thanks took some time to help me.
Laurent JULIENNE
SYNCER
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I just re-read your initial post and see that I misunderstood what you want to do. There are some DataStage functions that are available in the API, but those string and other functions you alluded to are not available. The TRIM() function is identical in scope in PX, but the "FIELD()" function and all of the specific field/value/subvalue functions are not present. Usually your option is to either use a BASIC transform stage or to completely redesign the job and its computations in a PX framework.
ljulienne
Participant
Posts: 10
Joined: Tue Jun 09, 2009 3:14 am
Location: Lyon, FRANCE
Contact:

Post by ljulienne »

ArndW wrote:I just re-read your initial post and see that I misunderstood what you want to do. There are some DataStage functions that are available in the API, but those string and other functions you alluded to ...
Thanks for the advice, but in fact, I don't want use BASIC Transformer bacause the routine have to be used in PX transformer.

An IBM consultant have to come in few days, so I will ask him the workaround.

Thanks for your help.
Laurent JULIENNE
SYNCER
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Can you name some specific functions that you feel need to written in c++? Perhaps if you do that others might be able to suggest alternatives.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

BASIC-style functions are used in the parallel Transformer stage and translated into C++ equivalents. You can inspect the generated C++ source code if you wish noting, however, that some of the "translations" involve opaque objects delivered with the product. Source code generated by Transformer stages is in the RT_SCnnn subdirectory (in the project directory on the server) where nnn is the job number.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ljulienne
Participant
Posts: 10
Joined: Tue Jun 09, 2009 3:14 am
Location: Lyon, FRANCE
Contact:

Post by ljulienne »

ljulienne wrote:
ArndW wrote:I just re-read your initial post and see that I misunderstood what you want to do. There are some DataStage functions that are available in the API, but those string and other functions you alluded to ...
Thanks for the advice, but in fact, I don't want use BASIC Transformer bacause the routine have to be used in PX transformer.

An IBM consultant have to come in few days, so I will ask him the workaround.

Thanks for your help.
Just for information, I got the answer from IBM consultant, and there is no header to be used in C++ routine.
Laurent JULIENNE
SYNCER
Post Reply