Let's say the following is being executed...
PERFORM PARA1
THRU PARA1-EXIT
VARYING SUB1 FROM COUNTER BY 1
UNTIL FIELD1 (SUB1) = 'END'
OR SUB1 = TABLE-MAX.
By definition this Perform steps through data stored in a table, starting with the "COUNTER" row, and processing rows sequentially, one row at a time.
Question: Can the SUB1 subscript be changed within the PERFORM, thereby interrupting the process so rows can be skipped, or the process move back in the Table to a row that is not the next sequential row? Or does COBOL take over control of the subscript (SUB1) so it can control the "VARYING".
I know I could move control of the PERFORM to PARA1 by adding code, but I'm looking at the 80/20 rule here: 80% of the time I will not need to interrupt the processing sequence.
PERFORM PARA1
THRU PARA1-EXIT
VARYING SUB1 FROM COUNTER BY 1
UNTIL FIELD1 (SUB1) = 'END'
OR SUB1 = TABLE-MAX.
By definition this Perform steps through data stored in a table, starting with the "COUNTER" row, and processing rows sequentially, one row at a time.
Question: Can the SUB1 subscript be changed within the PERFORM, thereby interrupting the process so rows can be skipped, or the process move back in the Table to a row that is not the next sequential row? Or does COBOL take over control of the subscript (SUB1) so it can control the "VARYING".
I know I could move control of the PERFORM to PARA1 by adding code, but I'm looking at the 80/20 rule here: 80% of the time I will not need to interrupt the processing sequence.