How to parameterize column name in transformer constraint

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
madsongtel
Participant
Posts: 31
Joined: Fri Aug 01, 2008 2:56 am

How to parameterize column name in transformer constraint

Post by madsongtel »

Hi All,

My requirement is I want to pass column name with some value as parameter (Lnk_In.EMP_ID=1234)in transformer constraint.
When I tried with that job is completed successfully, but no records are passing to output.

Could you please help me.
rschirm
Premium Member
Premium Member
Posts: 27
Joined: Fri Dec 13, 2002 2:53 pm

Post by rschirm »

Please provide more detail. Such as what you are physically placing in the constraint and how is the parameter getting set and with what value.
madsongtel
Participant
Posts: 31
Joined: Fri Aug 01, 2008 2:56 am

Post by madsongtel »

My job is like Dataset ---->Transformer--->Dataset

At run time for parameter first time i will give like EMP_ID=123 Or EMP_ID=234 Or EMP_ID=456

when i run second time i will give like EMP_NAME='AAA'
when i run thirs time i will give like GRADE='AA'

depends on the requiremnt i will pass at run time.

How can i do this in transformer. We can do this by using filter stage also.
rschirm
Premium Member
Premium Member
Posts: 27
Joined: Fri Dec 13, 2002 2:53 pm

Post by rschirm »

The problem with using a job parameter is it takes the value specified and treats as a string. And since the string value that you are passing is not TRUE the rows will not go out. This can be accomplished by doing the following:

First set up 2 Job Parameters; a=column name, b=value

StageVariable1 = If JobParamA = 'name' then link.name else if JobParamA = 'grade' then link.grade else .... (continue on for each column possibility with the ending else = "")

StageVariable2 = if StageVAriable1 = JobParamB then 1 else 0

Then use StageVariable2 as the constraint on the output link.
Post Reply