cancel
Showing results for 
Search instead for 
Did you mean: 

Reg mesasge mapping

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

jyothi_anagani
Active Contributor
0 Kudos

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.

Answers (1)

Answers (1)

Former Member
0 Kudos

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