About routines

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
dodda
Premium Member
Premium Member
Posts: 244
Joined: Tue May 29, 2007 11:31 am

About routines

Post by dodda »

Hi All,

Can you please tell me How to call from one Routine to another Routine..



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

Post by ray.wurlod »

There is nothing special about parallel routines - they are regular C++ functions. So is the calling mechanism.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
dodda
Premium Member
Premium Member
Posts: 244
Joined: Tue May 29, 2007 11:31 am

DS routines

Post by dodda »

Please let me know the syntax..
I am writing routine in BASIC language.
While calling one routine from another routine i have used "call (....)" for ex..
i have a routine A. I want to call this A in routine B. Where as A is having arguments (jobname,stagename,input1,input2 and output).
i m calling this routine like ans= call A(arguments)
but is showing error messages..
pls let me know do i need to include any header files while coding.

Thanks in advance
OddJob
Participant
Posts: 163
Joined: Tue Feb 28, 2006 5:00 am
Location: Sheffield, UK

Post by OddJob »

If you have a routine called...
CallMe(Arg1)

You can call this from anther routine by using:
CALL DSU.CallMe(Ans,Arg1)

Ans is the return from CallMe. You need to add DSU. to the routine name to fully qualify it.

It's not possible to use Ans=CALL DSU.CallMe(Arg1). Using CALL to call a function, the first param is the return value (this is passed by reference).

Hope this is of help.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

You're confusing Functions with Routines. You declare external Functions using the DEFFUN statement, search the forum for that syntax. Then the Function can be used inline anywhere within your current Function or Routine. We CALL Routines and they don't need any declaration, just note that it has a DSU. prefix to the name you supply.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you are writing routines in DataStage BASIC why did you post in the parallel forum?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
dodda
Premium Member
Premium Member
Posts: 244
Joined: Tue May 29, 2007 11:31 am

Post by dodda »

Thanks OddJob
OddJob wrote:If you have a routine called...
CallMe(Arg1)

You can call this from anther routine by using:
CALL DSU.CallMe(Ans,Arg1)

Ans is the return from CallMe. You need to add DSU. to the routine name to fully qualify it.

It's not possible to use Ans=CALL DSU.CallMe(Arg1). Using CALL to call a function, the first param is the return value (this is passed by reference).

Hope this is of help.
Post Reply