call custom user-defined,Routine or transform in job control

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
talk2shaanc
Charter Member
Charter Member
Posts: 199
Joined: Tue Jan 18, 2005 2:50 am
Location: India

call custom user-defined,Routine or transform in job control

Post by talk2shaanc »

In one of my job, i wanted to call a routine(transform) in the job control to get a value then passing that derived value to a job invoked in the same job control.
I was geting error message: Array 'Routinename' never dimensioned.It was considering the 'Routinename' as an array, as the the call was something like : Var=Routinename(value1,valu2,value3) :)
Then i had to open Code of the routine/transform in the job control, and it was working fine.

I just want to know, is there some way to call a routine/transform, they way i did it in the first instance or its not possible and whenever i have such requirement, i will have to open up a routine code and add it in my job control.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You have to declare to your job control that the user-defined routine exists and supply argument placeholders and catalog name.

Code: Select all

DEFFUN RoutineName(Arg1, Arg2, Arg3) Calling "DSU.RoutineName"
The "DSU." prefix is DataStage's way of identifying user-written routines.

You simply can not use Transforms in your own code. What you can do is to copy and paste the derivation expression, and substitute variables or expressions for the Transform arguments. A Transfom is not a separately executable piece of code in the way that a Routine is.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
xcb
Premium Member
Premium Member
Posts: 66
Joined: Wed Mar 05, 2003 6:03 pm
Location: Brisbane, Australia
Contact:

Post by xcb »

Hi,

Here is one way of calling a custom routine from either Job Control code or another routine.

Code: Select all

DEFFUN MyRoutineName(Arg1, Arg2, ... , ArgN) Calling "DSU.MyRoutineName"
You can't reference a defined Transform as this is just an inline statement that gets placed into a Datastage Job at compile time.
Cameron Boog
talk2shaanc
Charter Member
Charter Member
Posts: 199
Joined: Tue Jan 18, 2005 2:50 am
Location: India

Post by talk2shaanc »

Thanks, Ray & xcb
Post Reply