Page 1 of 1

Can COBOL have multiple entry points in a program?

Posted: Mon Sep 14, 2015 3:17 pm
by Leena
Hi,

Can COBOL have multiple entry points in a program?

Re: Can COBOL have multiple entry points in a program?

Posted: Mon Sep 14, 2015 5:49 pm
by Robert Sample
Research the ENTRY statement in the Enterprise COBOL Language Reference manual.

Re: Can COBOL have multiple entry points in a program?

Posted: Mon Sep 14, 2015 6:21 pm
by William Collins
And the answer is Yes, as long as you use static CALLs.

There is, however, no reason in a modern program to use multiple entrypoints.

Re: Can COBOL have multiple entry points in a program?

Posted: Mon May 23, 2016 5:26 pm
by Leena
William Collins wrote:And the answer is Yes, as long as you use static CALLs.

There is, however, no reason in a modern program to use multiple entrypoints.
In past why we needed multiple entry points?

Re: Can COBOL have multiple entry points in a program?

Posted: Tue May 24, 2016 9:55 pm
by William Collins
Well, they were never really needed, in the sense that you could arrange to do the same thing another way. Unless you wanted to get really tortuous.

ENTRY-points would allow different "functions" to be processed by the same program with a logical division of the code, but exactly the same thing can be achieved just by CALLing the main entry-point with something to tell what logic is to be followed for that particular requirement (imagine OPEN, READ, CLOSE "functions" for a file, for instance).

Where things get really tangled with ENTRY-points is where there are different parameter lists for the different entry-points. This type of junk is only written by "cool" coders who think that if something exists, it's sensible to use it, even if two weeks later they themselves won't know what is going on in the program. With any programs like this, it is best to rewrite them rather than constantly getting caught by the same issues.

Re: Can COBOL have multiple entry points in a program?

Posted: Wed Mar 08, 2017 3:37 pm
by Leena
Thanks. I think that's the reason that I have not seen many of such programs but manuals have a lot of details about them.