Calling a subroutine

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
nigel
Premium Member
Premium Member
Posts: 35
Joined: Tue May 07, 2002 2:48 am
Location: South Africa/UK
Contact:

Post by nigel »

Hi Nancy

If suppose you want to call the subroutine from the job control section of designer.

If that is the case, then here is your solution.

If your routine is call "MyRoutine" for example which has one argument "InputArg" ie. MyRoutine(InputArg), then you need to produce the following code: Call DSU.MyRoutine(Ans,InputArg) where Ans will be the output produced by the routine. Remember that in manager every routine (except before/after routines) must produce a result as teh variable "Ans".
This may seem comfusing as you define the routine with 1 argument but call it with 2 arguments (the 1st arg being the result, the 2nd is the inout arg).

You could add a parameter in your job design and then reference/pass it as an argument to your routine.

Hope this is useful

Regards

Nigel

Nigel
Post Reply