Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Difference between Entry and External Entry in PL/1

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 160
Location: India

PostPosted: Tue Aug 25, 2009 6:07 pm    Post subject: Difference between Entry and External Entry in PL/1
Reply with quote

Hi

I have some subroutines declared in my PL/1 program as below.

DCL RPFREAD ENTRY(*,*);
DCL RPFOPEN ENTRY(*);
DCL SGMGS EXTERNAL ENTRY(*,*);

Can any one explain the difference between Entry and External Entry statements in PL/1?
Back to top
View user's profile Send private message

Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Tue Aug 25, 2009 6:38 pm    Post subject:
Reply with quote

An external procedure is one whose text is not contained in any other block. The source text of an external procedure can be compiled separately from that of a calling procedure. The differences between internal and external procedures are as follows:

Before an external procedure can be invoked (except through an entry variable), its name must be declared within the procedure that invokes it. The DECLARE statement for the external entry name must also provide a list of parameter descriptors that give the data types of the parameters that the procedure requires, if any, as well as a RETURNS attribute for a function procedure.

You cannot explicitly declare internal procedures. The procedure name is implicitly declared by its occurrence in the PROCEDURE or ENTRY statement.

External procedures can reference the same variable only if it is declared (implicitly or explicitly) with the EXTERNAL attribute in all of them.
An internal procedure, on the other hand, can reference internal variables declared in any procedure in which it is contained.
Any procedure can call an external procedure.

An internal procedure can be called only by the procedure that contains it or by other procedures at the same level of nesting within the containing procedure. The only exception is invocation through an entry variable.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1060
Location: Oostende, Belgium

PostPosted: Tue Aug 25, 2009 7:09 pm    Post subject:
Reply with quote

Srihari Gonugunta wrote:
Before an external procedure can be invoked (except through an entry variable), its name must be declared within the procedure that invokes it. The DECLARE statement for the external entry name must also provide a list of parameter descriptors that give the data types of the parameters that the procedure requires, if any, as well as a RETURNS attribute for a function procedure.


  • it does not have to be declared, the compiler is in many instances smart enough to assume that it is dealing with external entries
  • a list of parameters is never compulsory
  • if no returns attribute is given, normal PL/I rules for identifier names are followed
Back to top
View user's profile Send private message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 160
Location: India

PostPosted: Tue Aug 25, 2009 7:47 pm    Post subject:
Reply with quote

Thanks Prins,

Still I am not clear with the ENTRY and EXTERNAL ENTRY keywords.

Can you please clarify the difference between ENTRY and EXTERNAL ENTRY with an example?

Thanks in advance.
Back to top
View user's profile Send private message
sai.dara

New User


Joined: 24 Aug 2007
Posts: 12
Location: Hyderabad

PostPosted: Tue Aug 25, 2009 8:27 pm    Post subject: REG: entry statement
Reply with quote

are you familiar with JCLs

External Entry is similar to Cataloged Procs and Entry is similar to Instream procs.

External Entry statement says that there is a submodule which will be used in this module. This external module is already coded, compiled and tested. Its definition is not coded in the current module. This helps in modularising your code, re usability of your code and thus easily maintained.

in your example it is DCL SGMGS EXTERNAL ENTRY(*,*);

Where as in

DCL RPFREAD ENTRY(*,*);
DCL RPFOPEN ENTRY(*);

these two submodules are defined/coded in the current module.
They are not visible outside this module.

is this clear ?

Thanks,
Sai
Back to top
View user's profile Send private message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 160
Location: India

PostPosted: Wed Aug 26, 2009 9:45 am    Post subject:
Reply with quote

Hi Sai,


But all the three modules which I mentioned are coded outside of the current/main module.

Main module is just calling all the three submodules with CALL statement. It seems your answer need to correct.

Can anyone explain please?
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1060
Location: Oostende, Belgium

PostPosted: Wed Aug 26, 2009 10:45 am    Post subject:
Reply with quote

Sai's answer is utter billshut and he obviously didn't even try to compile something like:
Code:
PRINO: PROC OPTIONS(MAIN) REORDER;
DCL IN ENTRY();
IN: PROC;
END IN;
END PRINO;


because it results in a

Code:
IBM1306I E          2  Repeated declaration of IN is invalid and will be
                       ignored.

error message.

The simple answer is that ENTRY declares are IMPLICITELY external, so there isn't one feck difference between

Code:
dcl entry entry;
and
Code:
dcl entry entry ext;
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10326
Location: italy

PostPosted: Wed Aug 26, 2009 3:33 pm    Post subject: Reply to: Difference between Entry and External Entry in PL/
Reply with quote

why do You post the same question in multiple forums ?

choose one and stick to it
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    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 Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts Difference between TWALENG and TWASIZE Arunkumar Chandrasekaran CICS 3 Tue Jan 03, 2017 12:57 pm
No new posts Sticky: difference between ... DUMMY ... and ... enrico-sorichetti JCL & VSAM 0 Mon Oct 17, 2016 4:31 pm
No new posts Automation of data entry using Rexx i... zingy.rajeev CLIST & REXX 4 Mon Aug 22, 2016 4:13 pm
This topic is locked: you cannot edit posts or make replies. Automation of data entry using Rexx i... zingy.rajeev CICS 0 Mon Aug 22, 2016 4:11 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us