I have a copybook with an array of 30 products that I need to map to a XML message and a field that content the number of iterations that have information, but if there are not the 50 products some iteration come empty.
Actually I have a WTX map that map the array, but the map iterate over all the array even some iterations dont have information.
How can I map/validate only the iteration with information? Or how can i use the field en the copy book that indicate the number of iterations that have information to only map this ocurrences without go through all the array?
If you have a copybook with a fixed number of elements, all the elements are always there. That's how copybooks work - a fixed record size makes it easy to find a record's position in a file.
If you don't want to map all of them, you will have to add an IF testing for some condition telling you that the slot is not empty. Like whether
part_number
(or something) is greater than zero (or not blank, depending on your data types).