IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Procedure Division Section


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
socker_dad

Active User


Joined: 05 Dec 2006
Posts: 177
Location: Seattle, WA

PostPosted: Wed Jun 12, 2019 12:21 am
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Jun 12, 2019 1:09 am
Reply with quote

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
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1041
Location: Richmond, Virginia

PostPosted: Wed Jun 12, 2019 2:01 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts Invoke stored procedure via batch JCL. DB2 2
No new posts FD Section to Create FB or Vb File Dy... COBOL Programming 1
No new posts Calling COBOL DB2 program from a COBO... COBOL Programming 2
Search our Forums:

Back to Top