View previous topic :: View next topic
|
Author |
Message |
saidharrao Warnings : 1 New User
Joined: 19 Feb 2005 Posts: 27 Location: hyderabad-ap-india
|
|
|
|
Hi,
Can anybody explain me what an 'ENTRY Point' means. I dont know ASSEMBLER but know IMS. In many programs I have seen ENTRY statement. WHat is this concept?
In IMS programs we use ' ENTRY DLITCBL'..I dont know what actually it means. Similarly in Link modules we use ENTRY statement. Sometimes the member name mentioned in ENTRY of the Link module is different from the actual program.
I am very thankful to you if somebody can explain me in detail.
Cheers. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
An entry point is the location of the first instruction to be executed when the program is invoked. There can be multiple entry points in a single program, as long as each is unique. The entry name does not have to be the module name of the load module; however, if there is no entry point specified the default entry point is the load module name. If a program has 3 entry points, you can use CALL <entry point name> for each to start the program in different spots.
There are some special requirements and if this is something you're needing you should read the language reference manual for your language of choice. |
|
Back to top |
|
|
saidharrao Warnings : 1 New User
Joined: 19 Feb 2005 Posts: 27 Location: hyderabad-ap-india
|
|
|
|
Thanks Robert. But I still have some ambiguity.
Case 1:
I have a COBOL program by name 'PGM 1'. The first line in Procedure division of this program is 'ENTRY 'DLITCBL USING pcb-1 pcb-2 pcb-3...
When I started executing the PGM 1, do you mean that the program starts executing from 'DLITCBL'? Technically do you mean the control goes to 'DLITCBL' and execute and come back to the next line of PGM 1? In what way is this different from CALL 'DLITCBL'?
Case 2:
I have a COBOL program 'PGM 2'. This is a normal program but nothing to do with IMS.
Somewhere down the line in Procedure divison I have
ENTRY 'A' using abc, xyz...
after 10 lines I have another statement like
ENTRY 'B' using zzz, xxx...
The Link of PGM 2 has ENTRY (PGM 2). WHat does it mean?
If the Link of PGM 2 had been ENTRY (A) or ENTRY (B), what do they mean and how they are different from ENTRY (PGM 2)? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
For case 1, the DLITCBL code is where execution begins and then your code is invoked. For a longer descritpion, i'd suggest you talk with your IMS dba who can explain completely.
For case 2, either A or B could be called if both had a named entry point. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
An ENTRY statement does not ever, under any circumstances, call another program. So your case 1 referring to ENTRY 'DLITCBL' will not be calling another program. What the ENTRY statement does is establish, for the linkage editor / binder, an alternate entry point to the program. So another program can say CALL 'PGM1' or CALL 'DLITCBL' to get to your program. If the ENTRY statement is the first line of the PROCEDURE DIVISION, there's no practical differences between the program name and the ENTRY point since the program starts at the first line of the PROCEDURE DIVISION -- which is the starting point for DLITCBL. There is some overhead code associated with program start up and I haven't looked at any output to see for sure, but I suspect the overhead entry code would be different for the program name and the ENTRY point.
The linkage editor / binder input for your case 2 should be, for full reference,
Code: |
ENTRY A
ENTRY B
ENTRY PGM2
NAME PGM2(R)
|
The linkage editor / binder uses the provided input to provide alternate entry points to the program. So If the full input I showed is performed, you could issue a CALL 'A', CALL 'B', CALL 'PGM2' and get into the same program PGM2 but at different starting points. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
So your case 1 referring to ENTRY 'DLITCBL' will not be calling another program. |
"Call" may have been a bad word to use. . .
Several database products are set up to link database code "around" the application code with the ENTRY being a point in the database code. This code establishes continuity between the application and the database engine. Once the database processes contained in the entry code are done, control is transferred to the actual application code. When the application process completes, control is returned to the database "controller" and then the process is terminated. |
|
Back to top |
|
|
|