Six Stars

runtime # of loop in Talend Data Mapper

Hi 

 

I am processing an incoming Mainframe file, which has data format simillar to the below xml.  In the message No_of_Transactions field will say how many number of transactions will come under that branch header. Single file will have many branch headers. I am converting the output to a Flat CSV format.

 

How can i perform loop in such scenario, by taking the value from the another key?

 

Input DataFormatInput DataFormat

  • Exchange components
Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Six Stars

Re: runtime # of loop in Talend Data Mapper

I just depicted the input in xml format, but my source was mainframe data with fixed length data in EBCDIC format. As the expected data is 3 times and some times data comes less than that. I had the loop for 0 to 3 times. So when i receive the data less than 3, it was generating null records.

 

I have handled it with the if clause expression on the simple loop checking for not null. It worked.

2 REPLIES
Five Stars

Re: runtime # of loop in Talend Data Mapper

Hi, 

If you want to save all of your transaction details you have to iterate using the Transaction_detail node as XPath loop expression and you will get all of them. Then, you can access the other elements inside the Branch_Header using relative paths.

Six Stars

Re: runtime # of loop in Talend Data Mapper

I just depicted the input in xml format, but my source was mainframe data with fixed length data in EBCDIC format. As the expected data is 3 times and some times data comes less than that. I had the loop for 0 to 3 times. So when i receive the data less than 3, it was generating null records.

 

I have handled it with the if clause expression on the simple loop checking for not null. It worked.