Stage Variable Declare

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
laknar
Participant
Posts: 162
Joined: Thu Apr 26, 2007 5:59 am
Location: Chennai

Stage Variable Declare

Post by laknar »

Number amount currency Code CustID Address
123456 10.00 22 21 123 London
123456 10.00 22 11 234 Chennai

Address Table


CustID Address
123 London
234 Chennai

I have to findout duplicate based on Number ,amount,currency columns
and if code starts with 2 and populate corresponding address.

Else if code column start with 1 then populate code starts with 2 Address value.

The above is exact logic im trying.

Where as Address values are in different table and Im taking as lookupset in a job.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

How is this new question different from this question?

Do you have any idea how annoying being asked the same question multiple times is?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
laknar
Participant
Posts: 162
Joined: Thu Apr 26, 2007 5:59 am
Location: Chennai

Post by laknar »

Hi,

Can you please explain the below functionality,how it works.

if CustID[1,1] = '1' then DSLink1.Address else StageVar1

simply populate your output column with StageVar1
Regards
LakNar
mdbatra
Premium Member
Premium Member
Posts: 175
Joined: Wed Oct 22, 2008 10:01 am
Location: City of London

Post by mdbatra »

U can get to know the functionality if you carefully observe the output of your job by changing the arguments([1,2], [1,4] ...)
Rgds,
MB
laknar
Participant
Posts: 162
Joined: Thu Apr 26, 2007 5:59 am
Location: Chennai

Post by laknar »

Hi,

Is it need to assign any Initial Value for the stage variable.
Regards
LakNar
mdbatra
Premium Member
Premium Member
Posts: 175
Joined: Wed Oct 22, 2008 10:01 am
Location: City of London

Post by mdbatra »

It is obtain a substring of the input column.
Further,the expression you are calculating can be given as a constraint,Stage variable's derivation or an output column derivation.
Rgds,
MB
mdbatra
Premium Member
Premium Member
Posts: 175
Joined: Wed Oct 22, 2008 10:01 am
Location: City of London

Post by mdbatra »

Infact, not just the input ,any column on which you are operating.
Rgds,
MB
Post Reply