IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

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: 171
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: 8568
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: 1013
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

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts In JCL Procedure how we can execute R... CLIST & REXX 7
No new posts Usage of pre-processor statement in p... PL/I & Assembler 1
No new posts Missing SECTION break DFSORT/ICETOOL 9
No new posts SECTION BASED ON FIELD DFSORT/ICETOOL 10
No new posts Array in Cobol Db2 Stored Procedure DB2 4

Back to Top