Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Need explanation ENTRY declaration

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & ASSEMBLER
Author Message
Candy

New User


Joined: 09 Dec 2005
Posts: 17

PostPosted: Wed Jan 04, 2006 11:49 am    Post subject: Need explanation ENTRY declaration
Reply with quote

Hi Guys,

Can anyone explaing me in detail about the usage of ENTRY declaration in PL/1.

Rgds,
Candy
Back to top
View user's profile Send private message
References
PostPosted: Wed Jan 04, 2006 11:49 am    Post subject: Re: Need explanation ENTRY declaration Reply with quote

sairam

Active User


Joined: 30 Aug 2005
Posts: 58
Location: Kolkata

PostPosted: Thu Jan 05, 2006 3:54 pm    Post subject:
Reply with quote

Whenever you are using an external procedure in your program you have to declare the external procedure as entry.For example i am using the procedure XCLB008 in my main procedure and i first declare it like below

DCL XCLB008 ENTRY(CHAR(1),CHAR(*)) RETURNS(CHAR(32767) VAR);
dcl var1,var2 char(10)

then in the main procedure i am calling this as follows[/size]
var1='10-10-2005';
var2=XCLB008('7',var1);
and the external procedure should be compiled first and then the main procedure.
Back to top
View user's profile Send private message
shinjini_t

New User


Joined: 11 May 2005
Posts: 14
Location: Bangalore, India

PostPosted: Sat Feb 04, 2006 1:02 pm    Post subject: Re: Need explanation ENTRY declaration
Reply with quote

ENTRY basically asks the compiler to generate code to convert the ARGUMENTS to make them compatible with the PARAMETERS in the called program.
Example, this is a code snippet from my main program:

DCL CALL_PGM ENTRY (FIXED DEC(5,2),FIXED DEC(5,2)) RETURNS (FIXED DEC(7,2))

This means that the main pgm calls the CALL_PGM and passes 2 FIXED DEC(5,2) to it and gets a FIXED DEC(7,2) in return from it.

All for the compatibility of the ARGUMENTS which the main pgm passes and the PARAMETERS which the called program recieves in.

Shinjini
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & ASSEMBLER All times are GMT + 6 Hours
Page 1 of 1