Model Templates : Properties : Properties Segment Section : Iteration: Using the FOR/LOOP Statement

Iteration: Using the FOR/LOOP Statement

The data-item properties will consist of information for more than one data-item—you want information for a list of data-items. Each data-item in the list should appear as a separate entry with the corresponding information (synonym, description, attributes, and so on). To generate the same type of information for all the data-items in the list, use a FOR/LOOP statement. This structure iteratively performs statements for a given identifier whose value is set sequentially to the items in a list. The program executes all statements following the LOOP keyword for the identifier’s current value until it reaches the END LOOP; the program then loops back to the first statement in the loop and performs the same sequence of statements for the next item in the list.

In this example, the list is composed of data-items and is represented by the variable di_ids. The sequence of statements in the loop is generated for each item of the list, represented by the variable di.The loop terminates at the END LOOP, which is the second to the last statement in the template.