Passing array to function

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
giuseppe
Participant
Posts: 2
Joined: Tue Apr 27, 2004 7:42 am

Passing array to function

Post by giuseppe »

Hi.

I'm tryng to pass an array to function, but i have a problem when I use it.

Can you help me?

Thanks in advance.
acb
Participant
Posts: 6
Joined: Mon Mar 08, 2004 8:50 am

Post by acb »

Can you elaborate the question, I mean, what sort of problem you are getting.

Regards,
Bhanu.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Can you show us what you're trying to do?

It's certainly possible to pass an array to a function. Do you mean a dynamic array - which is only a character string, so ought not to present any problem? Or do you mean a dimensioned array, in which case there are some rules you must heed.

Read about the CALL, DIMENSION and MAT statements in the BASIC manuals to learn more.

Essentially, though, you must precede the dimensioned array argument's name both in the function/subroutine argument list and in the caller's argument list with the keyword MAT. The array must be dimensioned in the caller, and must be dimensioned in the called function/subroutine too (but only to specify one-dimensional or two-dimensional array; actual extent sizes are ignored).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
giuseppe
Participant
Posts: 2
Joined: Tue Apr 27, 2004 7:42 am

THANKS

Post by giuseppe »

I' tryng to pass a DIMENSION ARRAY to FUNCTION written with client MANAGER.
Thr problem was that in argument's tab i can write only alpha-numeric-character (e.g. "MAT arg1" i can't write).
Using your suggestions and re-declaring the argument like a dimensioned-array in function, I have resolved the problem.

THANKS a lot.
Post Reply