more than one argument in routines

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
tostay2003
Participant
Posts: 97
Joined: Tue Feb 21, 2006 6:45 am

more than one argument in routines

Post by tostay2003 »

Cant we have more than one argument for Before/After Subroutines. If not, they why does the RoutineActivity stage say that it can pass more than one argument?
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
The Arguments are InputArg and ErrorCode, this doesn't mean the InputArg can't be an array of parameters and their values that you can deconstruct to variables inside the routine or use predefined common area variables.

IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
meena
Participant
Posts: 430
Joined: Tue Sep 13, 2005 12:17 pm

Post by meena »

Hi tostay2003,
We can gave more than one argument in Routines.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Meena, you can specify optional arguments in user routines; but the number of parameters used in Before/After job routines as in the original post is fixed and you cannot change that.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

InputArg receives the contents of the Input Value field from wherever the subroutine was invoked. This might be a delimited string, that can be parsed within the subroutine code.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
tostay2003
Participant
Posts: 97
Joined: Tue Feb 21, 2006 6:45 am

Post by tostay2003 »

Which way is preferred, to use routine activity with 3 or 4 parameters concatenated (slight messy as each parameter is derived from a lengthy function) or a job with code in job control (will atleast split the messy parameter list into 3 or 4)
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I used to use job control extensively, but that was before sequences existed, now I think it is better for maintenance purposes to use a before/after routine and pass the parameters via one long dynamic array. DataStage is very, very efficient with strings so I wouldn't worry about the length.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

A Routine activity can only access a routine whose type is "transform function". This can have between one and 254 arguments.

A before/after subroutine is intended to be invoked from job or active stage properties; it is never invoked directly from job control/job sequence.

You can, of course, CALL a before/after subroutine (with "DSU." prefix) from any other 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.
meena
Participant
Posts: 430
Joined: Tue Sep 13, 2005 12:17 pm

Post by meena »

Hi ArndW,
That's true that we can not use more than the parameters specified in the BEFORE/AFTER Routines.
My reply is a wrong answer to the above question.
Meena, you can specify optional arguments in user routines; but the number of parameters used in Before/After job routines as in the original post is fixed and you cannot change that.
Thank you,
Post Reply