cancel
Showing results for 
Search instead for 
Did you mean: 

need help on my mapping requirement

former_member191435
Contributor
0 Kudos

Hi, I need help on below condition.

I want to disply the field in last line of output file.

There are 2 segment

1. Line 0....unbounded 2. Unit 0...Unbounded

I am creating output file with no records = no of line items If i get 5 Line segments the I am creating 5 records in output file. It is ok for me.

But , Now Units segment also unbonded with 2 fields 1. qualif 2. posnr

If Qualif = 10 then I need to map POSNR to target field.

Here I want to disply this posnr value in last record of a file. first four lines of this field is null and last line of a file should have to display this field value.

Please help me on this

Thanks,

Enivass

Edited by: enivas on Jan 2, 2012 10:53 AM

Accepted Solutions (0)

Answers (2)

Answers (2)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

This needs a UDF:


Qualif -> UDF -> target
Posnr -> /

UDF is of context type:

arguments: qualif

posnr


String temp = "";
for(int a=0;a<qualif.length;a++){
 if(qualif[a].equals("10")){
  temp = posnr[a];
  break;
 }
}
for(int a=0;a<qualif.length;a++){
  if(a<qualif.length-1){
    result.addSuppress();
  }
  else
   result.addValue(temp);
}

Hope this helps,

Mark

Former Member
0 Kudos

if( if without else) Qualif = 10(Here use equal function of test) then mapwith default then remove context then sort then collapse context then copy by value (4) then map this to the target posnr.