Iterative Expressions

An Iterative Expression is a report writer contruct you use to express arrays or a series of numerically-suffixed data items as one SOURCE or SUM statement. This construct replaces coding repetitive series' when incrementing a data item or subscript.
Restriction: This topic applies only when the AppMaster Builder AddPack has been installed, and applies only to Windows platforms.

Targets:

VSAM Batch and all other batch environments

Syntax for Format 1

Numerically suffixed data items

item-#num[/limit[/increment]]

Syntax for Format 2

1-dimensional array

arrayitem (#num[/limit1[/increment1]]) One subscript range

Syntax for Format 3

2-dimensional array

arrayitem (#num[/limit1[/increment1]], First subscript range
          #num2[/limit2[/increment2]]) Second subscript range

Syntax for Format 4

3-dimensional array

arrayitem (#num[/limit1[/increment1]], First subscript range
          #num2[/limit2[/increment2]], Second subscript range
          #num3[/limit3[/increment3]]) Third subscript range

General Rules:

  1. The first slash separating numeric descriptors of an iteration translates to THRU, the second slash to BY.
  2. Leading zeros in the starting number are generated in the SUM or SOURCE statements.

Parameters:

number Starting number
limit Top limit of the increment range, or bottom limit if the increment is negative
increment Integer increment value for intermediate data items

Example:

The following iterative expression:

SOURCE ARRAY-ITEM (#3, #2)

Replaces the following code:

SOURCE ARRAY-ITEM (1, 1)
SOURCE ARRAY-ITEM (1, 2)
SOURCE ARRAY-ITEM (2, 1)
SOURCE ARRAY-ITEM (2, 2)
SOURCE ARRAY-ITEM (3, 1)
SOURCE ARRAY-ITEM (3, 2)