Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Procedure Division Section

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
socker_dad

Active User


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

PostPosted: Wed Jun 12, 2019 12:21 am    Post subject: Procedure Division Section
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: 8449
Location: Dubuque, Iowa, USA

PostPosted: Wed Jun 12, 2019 1:09 am    Post subject:
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

Active Member


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

PostPosted: Wed Jun 12, 2019 2:01 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Array in Cobol Db2 Stored Procedure Ashishpanpaliya DB2 4 Wed Jan 09, 2019 3:06 pm
No new posts SQL Code 302 while executing stored ... Ashishpanpaliya DB2 8 Wed Aug 01, 2018 7:54 pm
No new posts sql code 331 while calling Stored Pro... Ashishpanpaliya DB2 5 Wed Aug 01, 2018 7:06 pm
No new posts Add delay in External stored procedure smenjoge DB2 1 Thu Jul 19, 2018 1:21 am
No new posts Handling result sets in the calling N... Rusikesh DB2 7 Fri Apr 13, 2018 12:25 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us