Previous Topic: SET StatementNext Topic: ADD Statement


Substring Notation

The (&A2,80) part of the following statement is referred to as substring notation. This means that it represents only one part of the total value of the variable &SCREEN. &SCREEN is an ACL/E variable that represents all the data on the screen and &A2 is the value of the accumulator A2. So &SCREEN(&A2,80) represents the 80 characters of screen data starting at position A2.

SET DATA(&A1),&SCREEN(&A2,80)

In this program, each time the loop is executed, A1 is incremented by 1 and A2 is incremented by 80. So, the first time the loop is executed (A1=1 and A2=1), DATA(1) is assigned a value equal to the 80 characters of screen data starting with position 1 on the screen. The second time the loop is executed (A1=2 and A2=81), DATA (2) is assigned a value equal to the 80 characters of screen data starting with position 81 on the screen, and so on.