on 05-14-2009 8:55 AM
HI Guys,
i have a requirement where i have a item segment which 0 to unbounded at my source and item segment which is 0 to unbounded in target...
and in the target segment i have a field FLAG...
for the last item in the source the flag should be mapped with constant value 1 for others it should be mapped to 0.
can any one please give me the UDF code....
Thanks,
Madhu
Hi ,
Use this UDF. While creating choose context not vale or Queue. Input is item
int len = item.length;
for (int i=0;i<len;i++)
{
if(i == len-1)
{
result.addValue("1");
}
else
{
result.addValue("0");
}
}
Map like this.
item----->UDF----->flag
I already tested this one. Working fine.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
u can remove context and accept array as input to UDF and then u can fill field value with all zeros and last value with one...now output of udf will be give to spiltbyconect(each value) and then mapped to output.
like
soruce-removecontextUDFspiltbyvalue(each value)-target
Regards,
Manisha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.