Previous Topic: Field References Made on Type 6 and Type 8 ParametersNext Topic: Execution JCL


Examples

The following examples illustrate how CA Culprit interprets references to subscripted fields during the output phase.

Example 1

010 AMT.5

0151*005 AMT.1
0151*010 AMT.2
0161*005 AMT.1
0161*010 AMT.2

Each occurrence of AMT.1 and AMT.2 is extracted and stored in the extracted items and statistics file during the extract phase. A reference to AMT.1 on a type 6 edit parameter returns the sum of all values extracted by the type 5 edit parameter that references AMT.1.

Example 2

010 AMT.5  SUBS

0151*005 AMT.SUBS
0161*010 AMT.SUBS
0162*005 AMT.3

During the extract phase, every occurrence of AMT.SUBS is extracted, as indicated by the current value of SUBS. During the output phase, every extracted value of AMT.SUBS is summed, regardless of the run-time value of SUBS during the extract phase. SUBS is the name of a total field during the output phase and no longer has a unique value as a subscript.

The value of AMT.3 during the output phase is the current value of the third occurrence of the total-time array, provided AMT.3 is not specified on a SORT parameter or on a type 5 edit parameter.

Example 3

010  AMT.3
0115 TOTAL1  AMT.1
0115 TOTAL2  AMT.2
0151*005 TOTAL1
0151*010 TOTAL2
0161*005 TOTAL1
0161*010 TOTAL2

TOTAL1 and TOTAL2 are implied subscript parameters that assign alternative names to the first and second occurrences of the multiply-occurring work field AMT. During the output phase, a reference to TOTAL1 and TOTAL2 yields the total values for each occurrence shown.

Example 4

010  AMT.3  SUBS
0115 TOTAL1  AMT.1
0115 TOTAL2  AMT.2
0151*005 AMT.SUBS
0161*005 TOTAL1
0162*010 TOTAL2

All extracted values of AMT are accumulated as a single value that is referenced in this example as AMT.SUBS. AMT.SUBS can be referenced during the output phase on a type 6 edit parameter or type 8 process parameter. TOTAL1 and TOTAL2 are references to the current value of the first and second occurrences of the array that stores values of AMT.