So I have an array created by defining with an occurs.
03 TestList OCCURS 2 TIMES.
05 WS-TL-Enabled PIC X.
05 WS-TL-Name PIC X(5).
05 WS-TL-Func PIC X(10).
05 WS-TL-Answer PIC X(13).
01 TestItem.
03 WS-TI-Enabled PIC X.
03 WS-TI-Name PIC X(5).
03 WS-TI-Func PIC X(10).
03 WS-TI-Answer PIC X(13).
PROCEDURE DIVISION.
COMPUTE WS-MAX = LENGTH OF TestGroup / LENGTH OF Test1.
PERFORM 10-TEST
VARYING WS-CNT
FROM 1
BY 1
UNTIL WS-CNT > WS-MAX
So I have an array created by defining with an occurs. Let's say I have OCCURS 10 TIMES. When it comes to the PERFORM VARYING (or whatever) is
there a way to iterate through the rows in the array without specifying
the same number of rows in the PERFORM, that is, the compiler knowing
how many rows are defined in WORKING-STORAGE, it can limit the number of iterations in the PERFORM?
On Wednesday, September 15, 2021 at 1:13:59 AM UTC-4, bruce....@gmail.com wrote:
Rick Smith wrote:
On Wednesday, September 15, 2021 at 1:13:59 AM UTC-4, bruce....@gmail.com wrote:
So best practice then is to oversize the array and read the data in from >somewhere, keeping track of how much is read in and then iterating the
table accordingly? I'm fine with that.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 88:16:23 |
Calls: | 6,658 |
Files: | 12,203 |
Messages: | 5,333,955 |