Use of dynamic arrays as stage variables

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
kh
Participant
Posts: 21
Joined: Mon Jun 09, 2003 11:16 am

Use of dynamic arrays as stage variables

Post by kh »

Can I have a stage variable whose derivation returns a dynamic array? If so, how do I access the individual values of this array for subsequent derivations on the output links? I tried using stagevarname<n> with no luck.
Kevin Hart
Apollo Group
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes. A stage variable can contain any value, and a dynamic array is just a string with delimiter characters.

How you access the individual elements depends on the delimiter character used in constructing the dynamic array.

A generic solution is to use the Field() function.

Code: Select all

Field(stagevariable, delimiter, fieldnumber, fieldcount)
The delimiter can be a system variable, such as @FM or @VM. The fieldcount argument is optional, and defaults to 1.

It should also be possible to use dynamic array ("angle bracket") notation in derivations.

Code: Select all

stagevariable<2>
stagevariable<1,4>
These might cause the expression editor to leave your derivations red, if it doesn't understand the syntax, but the job will compile and execute satisfactorily.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply