Accessing a whole row in a 2 dimensional array

Archive of postings to DataStageUsers@Oliver.com. This forum intended only as a reference and cannot be posted to.

Moderators: chulett, rschirm

Locked
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Accessing a whole row in a 2 dimensional array

Post by admin »

> Hi,
>
> Im trying to access a whole row in an array in Universe basic.
>
> Basically I store elements like this:
> Data(1,1) = A
> Data(1,2) = B
> Data(1,3) = C
>
> and I want to access all of a row in array Data, without having to
> say:
>
> Temp = Data(1,1) :Data(1,2) :Data(1,3)
>
> Cheers,
> Wendy Voon
> Consultant
> Black Diamond
> T e c h n o l o g i e s
> Level 3, 1 Southbank Boulevard,
> Southbank, Victoria 3006
> E-mail: wendy.voon@team.telstra.com
> Telephone: (03) 8696 - 5023
>
>
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post by admin »

Try:

MATBUILD row FROM Data USING ""

That works for the one case you give, but if you wanted to access a second row, say Data(2,1):Data(2,2):Data(2:3) you would have to use:

MATBUILD row FROM Data,start,end USING ""

and do some arithmetic to get the start and end variables set up. In this case it would be something like:

start = ((rownumber - 1) * 3) + 1
end = start + 2


> -----Original Message-----
> From: Voon, Wendy [mailto:Wendy.Voon@team.telstra.com]
> Sent: Tuesday, August 21, 2001 4:33 AM
> To: datastage-users@oliver.com
> Subject: Accessing a whole row in a 2 dimensional array
>
>
> > Hi,
> >
> > Im trying to access a whole row in an array in Universe basic.
> >
> > Basically I store elements like this:
> > Data(1,1) = A
> > Data(1,2) = B
> > Data(1,3) = C
> >
> > and I want to access all of a row in array Data, without
> having to say:
> >
> > Temp = Data(1,1) :Data(1,2) :Data(1,3)
> >
> > Cheers,
> > Wendy Voon
> > Consultant
> > Black Diamond
> > T e c h n o l o g i e s
> > Level 3, 1 Southbank Boulevard,
> > Southbank, Victoria 3006
> > E-mail: wendy.voon@team.telstra.com
> > Telephone: (03) 8696 - 5023
> >
> >
>
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post by admin »

thanks!


Wendy Voon
Consultant
Black Diamond
T e c h n o l o g i e s
Level 3, 1 Southbank Boulevard,
Southbank, Victoria 3006
E-mail: wendy.voon@team.telstra.com
Telephone: (03) 8696 - 5023


> -----Original Message-----
> From: len.greenwood@ascentialsoftware.com
> [SMTP:len.greenwood@ascentialsoftware.com]
> Sent: Tuesday, August 21, 2001 6:19 PM
> To: datastage-users@oliver.com
> Subject: RE: Accessing a whole row in a 2 dimensional array
>
> Try:
>
> MATBUILD row FROM Data USING ""
>
> That works for the one case you give, but if you wanted to access a
> second row, say Data(2,1):Data(2,2):Data(2:3) you would have to use:
>
> MATBUILD row FROM Data,start,end USING ""
>
> and do some arithmetic to get the start and end variables set up. In
> this case it would be something like:
>
> start = ((rownumber - 1) * 3) + 1
> end = start + 2
>
>
> > -----Original Message-----
> > From: Voon, Wendy [mailto:Wendy.Voon@team.telstra.com]
> > Sent: Tuesday, August 21, 2001 4:33 AM
> > To: datastage-users@oliver.com
> > Subject: Accessing a whole row in a 2 dimensional array
> >
> >
> > > Hi,
> > >
> > > Im trying to access a whole row in an array in Universe basic.
> > >
> > > Basically I store elements like this:
> > > Data(1,1) = A
> > > Data(1,2) = B
> > > Data(1,3) = C
> > >
> > > and I want to access all of a row in array Data, without
> > having to say:
> > >
> > > Temp = Data(1,1) :Data(1,2) :Data(1,3)
> > >
> > > Cheers,
> > > Wendy Voon
> > > Consultant
> > > Black Diamond
> > > T e c h n o l o g i e s
> > > Level 3, 1 Southbank Boulevard,
> > > Southbank, Victoria 3006
> > > E-mail: wendy.voon@team.telstra.com
> > > Telephone: (03) 8696 - 5023
> > >
> > >
> >
Locked