Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

What is an ENTRY statement?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
saidharrao
Warnings : 1

New User


Joined: 19 Feb 2005
Posts: 27
Location: hyderabad-ap-india

PostPosted: Fri Oct 17, 2008 11:19 pm    Post subject: What is an ENTRY statement?
Reply with quote

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
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7997
Location: Bellevue, IA

PostPosted: Fri Oct 17, 2008 11:38 pm    Post subject:
Reply with quote

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
View user's profile Send private message
saidharrao
Warnings : 1

New User


Joined: 19 Feb 2005
Posts: 27
Location: hyderabad-ap-india

PostPosted: Mon Oct 20, 2008 9:46 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Oct 20, 2008 11:48 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7997
Location: Bellevue, IA

PostPosted: Mon Oct 20, 2008 11:48 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Oct 21, 2008 12:12 am    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts VALIDATE NULL VALUE IN DB2 CASE STATE... useit DB2 5 Thu Feb 09, 2017 4:34 pm
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts COBOL DB2 - CALL statement - high CPU... TS70363 DB2 15 Sun Sep 11, 2016 6:07 am
No new posts Automation of data entry using Rexx i... zingy.rajeev CLIST & REXX 4 Mon Aug 22, 2016 4:13 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us