How to call the PX routine in job control of DS PX 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

Post Reply
yoganand
Participant
Posts: 3
Joined: Thu Nov 03, 2005 4:14 am

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

Post 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.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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!
yoganand
Participant
Posts: 3
Joined: Thu Nov 03, 2005 4:14 am

Post 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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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().
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
yoganand
Participant
Posts: 3
Joined: Thu Nov 03, 2005 4:14 am

Post by yoganand »

Arnd & ray,

Thanks for your advises.

I will try with alternates.


BestRegards,
Yoganand
gh_amitava
Participant
Posts: 75
Joined: Tue May 13, 2003 4:14 am
Location: California
Contact:

Post by gh_amitava »

Hi,

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

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

Post by ray.wurlod »

But it can't call a parallel routine.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply