View previous topic :: View next topic
|
Author |
Message |
Candy
New User
Joined: 09 Dec 2005 Posts: 16
|
|
|
|
Hi Guys,
Can anyone explaing me in detail about the usage of ENTRY declaration in PL/1.
Rgds,
Candy |
|
Back to top |
|
|
sairam
New User
Joined: 30 Aug 2005 Posts: 58 Location: Kolkata
|
|
|
|
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 |
|
|
shinjini_t
New User
Joined: 11 May 2005 Posts: 14 Location: Bangalore, India
|
|
|
|
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 |
|
|
|