How to call a routine inside a ds routine

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
pavlicic
Participant
Posts: 7
Joined: Thu Jul 14, 2005 5:00 am

How to call a routine inside a ds routine

Post by pavlicic »

Hi all,

I need to execute a ds routine inside a ds routine.
I put this in the code:

....

Var = MyRoutine('2004-01-01')

.....

inside a routine. The answer after compile it is "Array MyRoutine never dimensioned."

How can i do this?

Thanks for all.
talk2shaanc
Charter Member
Charter Member
Posts: 199
Joined: Tue Jan 18, 2005 2:50 am
Location: India

Post by talk2shaanc »

say you have routine RoutineA and RoutineB.
RoutineA has 2 arguments, filename and filepath.

Now you want to call RoutineA inside RoutineB.

RoutineB
Deffun RoutineA(A1,A2) calling "DSU.RoutineA"

var1=RoutineA(value1,value2)
------
-------------
----



Return(Ans)
Shantanu Choudhary
talk2shaanc
Charter Member
Charter Member
Posts: 199
Joined: Tue Jan 18, 2005 2:50 am
Location: India

Re: How to call a routine inside a ds routine

Post by talk2shaanc »

Sorry I forgot to write,
pavlicic wrote: Var = MyRoutine('2004-01-01')

inside a routine. The answer after compile it is "Array MyRoutine never dimensioned."
You got the above error while compiling the RoutineB because, you have not specifically given directive to compiler that 'MyRoutine' used in RoutineB is a Routine. If you dont give any directive the compiler will think that "MyRoutine" is an array variable.
Shantanu Choudhary
pavlicic
Participant
Posts: 7
Joined: Thu Jul 14, 2005 5:00 am

Post by pavlicic »

Ok, It runs perfectly.

Thanks
cellule
Charter Member
Charter Member
Posts: 3
Joined: Wed Oct 19, 2005 7:41 am

Using a procedure in a basic routine?

Post by cellule »

Hi,

And is it possible, in a basic routine, to use a group of statements more then once wihtout having to write it each time? Basically, is it possible to use the procedure concept (as in PL/SQL, C, etc.) without calling another subroutine?

Thanks!
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Cellule, this is a long-dead thread and normally it is best to start a new one with your new topic.
Look into the manual under the topic of "GOSUB" go get an answer to this query for repeating statements within a program, and the use of routines and functions for doing outside of a program.
Post Reply