nal_satish
New User
Joined: 20 Jun 2005 Posts: 25 Location: Hyderabad
|
|
|
|
Can any One Explain Regarding the Calls In PL/ I
Is Calls in PL/I Similar to calls in COBOL,
What is Difference between Static Call and Dynamic call in PL/I and How can we Differentiate it ?
Thanks & Regards,
Satish. |
|
Sridevi_C
Active User
Joined: 22 Sep 2005 Posts: 107 Location: Concord, New Hampshire, USA.
|
|
|
|
Hi,
"CALL" concept is same for both PL/I and COBOL. Like in COBOL, PL/I has static and dynamic call. Static call is directly calling by giving the subroutine name or entry name.
EX:-
M: PROC OPTIONS(MAIN);
DCL A,B FIXED DEC(5,2);
CALL SUB(A,B);
PUT LIST (A,B);
SUB: PROC (X,Y);
DCL X,Y FIXED DEC(5,2);
Y=X+100;
END SUB;
END M;
In Dynamic call, a variable is used in CALL and in run time , the name of the subroutine is given as input.
EX:-
M: PROC OPTIONS(MAIN);
DCL A,B FIXED DEC(5,2);
DCL EV ENTRY VARIABLE, SUB1 ENTRY, SUB2 ENTRY;
GET LIST(EV);
CALL EV(A,B);
PUT LIST (A,B);
END M;
SUB1: PROC (X,Y);
DCL X,Y FIXED DEC(5,2);
Y=X+100;
END SUB1;
SUB2: PROC (X1,Y1);
DCL X1,Y1 FIXED DEC(5,2);
Y1=X1-100;
END SUB2;
Do correct me for any mistake(s).
Thanks!
Sridevi |
|