Re:A Historical Perspective on COBOL (2020)
by DoomHotel on Friday May 07, 2021 @02:11PM
(#27078918)
We used PERFORM to implement calls. Whether or not implemented with a stack, it acts the same as any call/return. So to implement a simple loop to count records in a file:
PERFORM COUNT-ROWS
VARYING COUNT FROM 1 BY 1
UNTIL EOF.
PERFORM COUNT-ROWS VARYING COUNT FROM 1 BY 1 UNTIL EOF.
And the callee did:
READ INPUT-FILE AT END MOVE 1 TO EOF-FLAG.