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 

Multiple entry points in Cobol program.

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


Joined: 06 Mar 2008
Posts: 3
Topics: 2

PostPosted: Thu Mar 06, 2008 10:54 pm    Post subject: Multiple entry points in Cobol program. Reply with quote

I know that in PL/1 a single program can have multiple entry points which can be referred independently as required. Is the same kind of implementation possible in COBOL? Can I have multiple Identification divisions with different program ids in the same Cobol program?
_________________
Vishnu
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Fri Mar 07, 2008 4:02 am    Post subject: Reply with quote

the mechanics are not quite what you described, but yes you can have multiple entry points in a cobol program,

but

you need to static link to the multiple entry point program which makes it a real PITA.

suggest you use a copybook to define a 'pass-along' / 'interface' area which stipulates a function code which the program interprets and flow is controlled that way.

also allows for dynamic calls.

but

modules should be single function. exceptions are i/o modules (read/write files) and db2 modules. I like the idea of one module per table, and any/all sql for a particular table (selects, updates, inserts, cursors) is contained in one module.

multiple entry points is a hold over from last century's methodologies.

my advice is don't.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
vishnuap
Beginner


Joined: 06 Mar 2008
Posts: 3
Topics: 2

PostPosted: Fri Mar 07, 2008 10:56 am    Post subject: Reply with quote

dbzTHEdinosauer wrote:
the mechanics are not quite what you described, but yes you can have multiple entry points in a cobol program,

but

you need to static link to the multiple entry point program which makes it a real PITA.

suggest you use a copybook to define a 'pass-along' / 'interface' area which stipulates a function code which the program interprets and flow is controlled that way.

also allows for dynamic calls.

but

modules should be single function. exceptions are i/o modules (read/write files) and db2 modules. I like the idea of one module per table, and any/all sql for a particular table (selects, updates, inserts, cursors) is contained in one module.

multiple entry points is a hold over from last century's methodologies.

my advice is don't.
Thanks for that reply dbz. Left to me I will not touch that kind of programming with a pole of any length.

Unfortunately for me, I am sometimes required to support/maintain code written a few decades back and of late I have been asked about whether I can handle this type of code. Thanks again for the reply.

One more related question. Is this implementation specific to any dialect of COBOL or is it possible in any of the Cobol flavors?
_________________
Vishnu
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Fri Mar 07, 2008 1:40 pm    Post subject: Reply with quote

i know that it is so with cobol 2. but, after 2008 that will not be supported by ibm plus if you want to use db2 vsn greater than 6, you also have to migrate to 'COBOL 3' - enterprise cobol.

sorry, too lazy to look it up, but I would be suprised if multiple entry points are no longer supported.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
CraigG
Intermediate


Joined: 02 May 2007
Posts: 202
Topics: 0
Location: Viginia, USA

PostPosted: Fri Mar 07, 2008 2:53 pm    Post subject: Reply with quote

It is still there in Enterprise Cobol 3.2.
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