Skip to main content

I have input coming from source as records. Record-1 is xyz, record 2 is abc…

I need to merge all these values into a list by checking few conditions in groovy.

How do I achieve that. Finally output should come in groovy when reading all records is over.

like kxyz,abc,pqr]

 

But I am getting code output as

Output for record-1 dxyz]

output for record2 -dabc] and so on

Can someone please help me how its possible?

@Priyanka Mynepally 

 

Firstly, check if you are processing record by record or batch by batch. This is an advance property on your Groovy evaluator.

 

Next, by default, as soon as data is processed per record, sdc.write will write the output record. If you move this line of code after your records loop then it will write only once when the batch finishes. 

 

I hope that helps.


Reply