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.
And the callee did:
READ INPUT-FILE AT END MOVE 1 TO EOF-FLAG.
Re:A Historical Perspective on COBOL (2020)
by ASalazarMX on Friday May 07, 2021 @04:59PM
(#27080800)
Ah, the joys of forgetting to put a period at the end of the COUNT-ROWS paragraph.
I would add that in the era cobol was designed and rose to prominence, assembler was used for both. Cobol enshrined the application assembler practices of the time, all memory was statically declared, no dynamic memory allocation, no call stack, just gotos and conditional branching, and mapping fixed length data from tape drives into memory. Note this all made cobol very stable and even secure (no possibility for buffer overflows for example).
Also clearly not what was needed for true systems programming.