Joined: 05 Dec 2006 Posts: 171 Location: Seattle, WA
Here's an odd bit of COBOL:
VARYING WS-SUB-1 FROM +1 BY +1
UNTIL WS-SUB+1 > WS-LIC-STATUS
FROM +1 BY +1
UNTIL WS-SUB-2 > WS-LIC-STATUS
Is this like an inner loop on WS-SUB-2 with WS-SUB-1 being the outer loop? Such as the paragraph is performed until WS-SUB-2 is greater than the licenses status, then WS-SUB-1 is increased by 1 and we loop through WS-SUB-2 until it is greater than the licenses status again?
If that isn't what it's doing, does someone have an explanation?
Joined: 06 Jun 2008 Posts: 8553 Location: Dubuque, Iowa, USA
You could have coded up a test for this using a DISPLAY for 5500-PARAGRAPH in maybe 10 minutes and you would have gotten your answer much earlier.
Your assumption about how the PERFORM works is correct -- WS-SUB-2 is varied from 1 to WS-LIC-STATUS for each value of WS-SUB-1 starting at 1 and continuing until WS-LIC-STATUS. This is assuming, of course, that the typo error in your code is corrected (WS-SUB+1 could be either WS-SUB-1 + 1 or WS-SUB-1); your comments are assuming the latter case.