Can COBOL have multiple entry points in a program?
Can COBOL have multiple entry points in a program?
Hi,
Can COBOL have multiple entry points in a program?
Can COBOL have multiple entry points in a program?
- Robert Sample
- Global Moderator
- Posts: 1903
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Can COBOL have multiple entry points in a program?
Research the ENTRY statement in the Enterprise COBOL Language Reference manual.
-
- Global Moderator
- Posts: 490
- Joined: Sun Aug 25, 2013 7:24 pm
Re: Can COBOL have multiple entry points in a program?
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.
There is, however, no reason in a modern program to use multiple entrypoints.
Re: Can COBOL have multiple entry points in a program?
In past why we needed multiple entry points?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.
-
- Global Moderator
- Posts: 490
- Joined: Sun Aug 25, 2013 7:24 pm
Re: Can COBOL have multiple entry points in a program?
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.
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?
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.
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute