View previous topic :: View next topic
|
Author |
Message |
socker_dad
Active User
Joined: 05 Dec 2006 Posts: 177 Location: Seattle, WA
|
|
|
|
I've been assigned some maintenance work on a very old COBOL program that has the SECTION statement in the Procedure Division and had a few questions about this as the manual isn't very extensive on the topic.
If I remember my classes from 25 years ago correctly, the Section is made up of one or more paragraphs and can they be performed in toto by performing the Section name. In the code below, the Perform statement will perform both paragraphs under S001 until it reaches S002.
Can individual paragraphs within in a Section be performed by themselves, such as Perform S001a-PARA-1A?
The end of a section is either another section or the end of the program, right?
Code: |
PERFORM S001-SECTION-A
S001-SECTION-A SECTION.
S001A-PARA-1A
S001B-PARA-1B
S002-SECTION-B SECTION.
|
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
Can individual paragraphs within in a Section be performed by themselves, such as Perform S001a-PARA-1A?
The end of a section is either another section or the end of the program, right? |
Yes, individual paragraphs can be performed by themselves -- as long as they don't cause recursion.
The end of a SECTION may be another SECTION, or the end of the program -- or an EXIT paragraph when PERFORM A THRU B is coded and B is an EXIT paragraph. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
How hard would it be, really, to create a library of test programs.
One would test just the questions you asked. Should take maybe 30 minutes tops.
Then you would be the expert at this topic, rather than just remembering what some other "expert" (or maybe not - no offense Robert Sample - I acknowledge your expertise) said.
If you have programmers working under you, this would be an excellent habit to instill in them as well. |
|
Back to top |
|
|
|