MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sections to Paragraphs

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
yadav2005
Intermediate


Joined: 10 Jan 2005
Posts: 348
Topics: 144

PostPosted: Wed Aug 12, 2009 5:47 pm    Post subject: Sections to Paragraphs Reply with quote

Members,

I have an old COBOL program written with SECTIONS. I have made changes to the program to have paragraphs instead of SECTIONS for my ease of use and clear understanding. The way program is working with SECTIONS is somewhat different from paragraphs and this could be my mistake while conversion. Are there any ways to handle this , I mean can i get some useful tips to clarify myself while converting SECTIONS to Paragraphs.
Back to top
View user's profile Send private message
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Wed Aug 12, 2009 5:58 pm    Post subject: Reply with quote

Since the start of a SECTION is the end of the previous one, you will have a problem if there were any other paragraphs within a SECTION. In other words, it won't be a one-for-one type of conversion. When you PERFORM a section, every paragraph within that section gets performed and the section ends either with the start of the next section or end of source code. Was there a requirement to convert to paragraphs? Some shops say "sections only", some say "paragraphs only". It's not a good idea to have both in the same program. Read about sections in the Language Reference Manual.
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
jctgf
Beginner


Joined: 05 Nov 2006
Posts: 89
Topics: 36

PostPosted: Wed Sep 30, 2009 10:00 am    Post subject: Reply with quote

I agree: it
Back to top
View user's profile Send private message Send e-mail
Anuj Dhawan
Intermediate


Joined: 19 Jul 2007
Posts: 298
Topics: 7
Location: Mumbai,India

PostPosted: Wed Sep 30, 2009 1:02 pm    Post subject: Reply with quote

A bit of history: A SECTION can contain more than one paragraph. Doing a PERFORM of a SECTION means multiple paragraphs may be executed. Having SECTION names in the PROCEDURE DIVISION is not required.

Way back when a mainframe could have as little as 64K of memory, the SECTION names were numbered and these SECTION numbers were used to define the overlay structure of the program. This allowed swapping of pieces of the program not currently in use out to auxiliary storage so larger programs than would physically fit in memory could be executed. This practice has been obsolete for quite some time since mainframes have more memory these days. /History off/

You perform a para or a section and execution stops at the next para or section name. If the performing a para, the paragraph with the exit statement is just another paragraph so sometimes they can use 'GO TO'. But catch is, without the para names in the sections, they can't write their GO TO's.

And as others have said it's unwise to have both in the same program.
_________________
Regards,
Anuj
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group