Page 1 of 1

How to call the PX routine in job control of DS PX job

Posted: Wed Mar 01, 2006 6:49 am
by yoganand
Hi,

I have created one parallel routine in DS 7.5.1A
This routine is of type "External Transformer".

I am trying to call this PX routine in Job control section of a PX job using below code...

DEFFUN DSU.MyFunc(int)
RetCode= DSU.MyFunc(100)



Job is getting aborted.


can any one suggest me how to call routine in job control section.


Thanks,
Yogi.

Posted: Wed Mar 01, 2006 6:56 am
by ArndW
Could you tell us what your error message was? You should be able to call Routines from the job control section of PX jobs.

Posted: Wed Mar 01, 2006 8:09 am
by ray.wurlod
Parallel routines do not undergo the same "catalog" mechanism that server job routines do, hence DEFFUN declarations are inappropriate. Parallel routines are not readily called from job control code, since parallel routines are written in a different language (C++) from job control code (DataStage BASIC). Whilst it's technically possible, using the GCI mechanism, this involves relinking your dssh executables, and so we normally advise against this route. Instead, create a server routine with equivalent functionality.

Posted: Wed Mar 01, 2006 9:40 am
by ArndW
I missed the "Parallel Routine" part - I saw the DSU text and thought that perhaps the routine hadn't been compiled or was incorrectly typed, I hadn't realized that the poster wasn't trying to call a BASIC routine. Thanks for catching that one!

Posted: Thu Mar 02, 2006 3:51 am
by yoganand
Ray,

These routines needs to execute in both job control and PX Transformer.
If I write server routine we can not use those routines in PX transformer.

I wrote PX routines which are working in PX Transformer and I want to use same routines in job control section of PX job.

Thanks,
Yoganand

Posted: Thu Mar 02, 2006 4:32 am
by ArndW
Yoganand,

as Ray has already pionted out, you need to do some complicated work to make the DataStage BASIC or server engine call an external routine in C++.

You will need to define the GCI parameters and re-link the dssh/uvsh executable. There is a manual available on IBM's website describing how to do this with the 99% compatible UniVerse engine; but I am certain that this functionality is not officially supported by IBM/Ascential for DataStage (although it will work).

Perhaps you can do a simpler workaround - change your routine into a UNIX program that accepts it's parameters on the command line and then call this program from the before/after code with DSExecute().

Posted: Thu Mar 02, 2006 6:55 am
by ray.wurlod
yoganand wrote:Ray,

These routines needs to execute in both job control and PX Transformer.
If I write server routine we can not use those routines in PX transformer.

I wrote PX routines which are working in PX Transformer and I want to use same routines in job control section of PX job.

Thanks,
Yoganand
And I suppose you expect a zone 4 DVD to work in a zone 1 player too. Either you modify the player to multi-zone (equivalent to linking your parallel routine into the dssh executable and invoking it with the GCI), or you get a zone 4 player (write an equivalent server routine to be called from job sequences).

Posted: Thu Mar 02, 2006 7:34 am
by yoganand
Arnd & ray,

Thanks for your advises.

I will try with alternates.


BestRegards,
Yoganand

Posted: Thu Mar 02, 2006 4:18 pm
by gh_amitava
Hi,

You can design Sequence instead of Job Control. It is possible to call a external routine from Sequence.

Regards
Amitava

Posted: Thu Mar 02, 2006 4:29 pm
by ray.wurlod
But it can't call a parallel routine.