IBM MAINFRAME HELP & SUPPORT FORUMS
Technical Forums for IBM Mainframe Applications like COBOL, JCL, CICS, DB2, FileAid, DFSORT, Endevor, Xpediter, CoolGen, CA-7&11, AbendAid, IMS, IDMS, PL/I, MqSeries, SyncSort, Assembler, ChangeMan, Easytrieve, InterTest, REXX, CLIST etc...
 

Need explanation ENTRY declaration

THIS IS AN ARCHIVE FORUM: CLICK HERE TO GO TO THE ORIGINAL TOPIC

 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> PL/I & ASSEMBLER
View previous topic :: View next topic  
Author Message
Candy



Joined: 09 Dec 2005
Posts: 17

Posted: Wed Jan 04, 2006 11:49 am    Post subject: Need explanation ENTRY declaration  

Hi Guys,

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

Rgds,
Candy
Back to top  
sairam



Joined: 30 Aug 2005
Posts: 58
Location: Kolkata

Posted: Thu Jan 05, 2006 3:54 pm    Post subject:  

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



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

Posted: Sat Feb 04, 2006 1:02 pm    Post subject: Re: Need explanation ENTRY declaration  

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  
 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> PL/I & ASSEMBLER
Page 1 of 1
THIS IS AN ARCIVE FORUM IN READ ONLY MODE. IF YOU WANT TO ASK YOUR DOUBTS USE THE ACTUAL FORUM