View previous topic :: View next topic |
Author |
Message |
vishnuap Beginner
Joined: 06 Mar 2008 Posts: 3 Topics: 2
|
Posted: Thu Mar 06, 2008 10:54 pm Post subject: Multiple entry points in Cobol program. |
|
|
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 |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Fri Mar 07, 2008 4:02 am Post subject: |
|
|
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 |
|
|
vishnuap Beginner
Joined: 06 Mar 2008 Posts: 3 Topics: 2
|
Posted: Fri Mar 07, 2008 10:56 am Post subject: |
|
|
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 |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Fri Mar 07, 2008 1:40 pm Post subject: |
|
|
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 |
|
|
CraigG Intermediate
Joined: 02 May 2007 Posts: 202 Topics: 0 Location: Viginia, USA
|
Posted: Fri Mar 07, 2008 2:53 pm Post subject: |
|
|
It is still there in Enterprise Cobol 3.2. |
|
Back to top |
|
|
|
|