Page 1 of 1

How to call a routine inside a ds routine

Posted: Thu Jul 14, 2005 5:13 am
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.

Posted: Thu Jul 14, 2005 5:27 am
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)

Re: How to call a routine inside a ds routine

Posted: Thu Jul 14, 2005 5:34 am
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.

Posted: Thu Jul 14, 2005 5:43 am
by pavlicic
Ok, It runs perfectly.

Thanks

Using a procedure in a basic routine?

Posted: Mon Jun 12, 2006 9:58 am
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!

Posted: Mon Jun 12, 2006 10:10 am
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.