1.2k questions

1.4k answers

361 comments

339 users

Categories

Sidebar
0 votes
652 views
by kevin-w-8265 (120 points)
The fixed length file mapping processes only the first record. This happens even in test mode though there are multiple rows in the sample message. Thank you.

1 Answer

0 votes

You need to use the message.getCount('/) to get the row count. Then use a for loop to iterate over each row.

//Get the rowCount and then loop through each.
var rowCount = message.getCount('/');
qie.debug('rowCount: ' + rowCount);

//This for loop is what will allow you to get each row.
for (var j = 1; j <= rowCount; j++) {
   //nodetag syntax = Begin Index, Width [ Row Index ]
   qie.info('col1: ' +  message.getNode('2,5[' + j + ']'));
   // so this starts at column 2 and goes 5 spaces. j defines what row to get.
   qie.info('col2: ' +  message.getNode('12,8[' + j + ']'));
   // so this starts at column 12 and goes 8 spaces. j defines what row to get.
}

by brandon-w-8204 (34.1k points)
by kevin-w-8265 (120 points)
The fixed length file is the source. The desired output is the message. message.getCount('/') seems invalid for this and returns 0. source.getCount('/') returns 1. The fixed length is 102 characters. Is there another parameter that should be used in .getCount()? Thanks.
by gary-t-8719 (15.1k points)
The fixed length messages require that the message have a newline (\n) character for each row.  QIE handles the carriage return (\r) but requires that the newline is present.  In his case, the sample message only had a carriage return, but no newline character. So the solution is to ensure that your sample message has a newline character. If your actual live messages don't have a newline character then a preprocessor script can be used to add it.
...