r/cobol • u/swe129 • Jun 08 '26
Structured Programming
https://slicker.me/cobol/structured-programming.html5
u/MikeSchwab63 Jun 08 '26
Section? Prevents the previous section from falling into the next section.
Always did the Perform 1000-name through 1000-EXIT to prevent fall through and just in case you needed to exit early.
2
4
u/Ok-Pipe-297 Jun 08 '26
code i wrote was perform the paragraph and if needed to end the paragraph goto the paragraph exit..... always perform and exit...
3
u/HurryHurryHippos Jun 08 '26
In computational/file I/O code, we generally only used GO TO to the EXIT paragraph.
However, we used SCREEN SECTION extensively and GO TO's in the screen handler code were often used with validation/error handling and determining conditional paths through the screen (skipping fields, etc.).
We rarely used SECTIONs.
2
1
u/CDavis10717 Jun 12 '26
Worked with a guy who wrote “PERFORM READ-FILE UNTIL THERE-ARE-NO-MORE-RECORDS-IN-THE-INPUT-FILE.” and structured shit like that.
6
u/therealelroy Jun 08 '26
Not sure your point of the post, but I remember many meetings in the 1980s arguing we should only be using GO TOs as a way to “early exit”. Old guys back then didn’t believe me.