🎴 Flashcard Mode
Mainframe Programming: COBOL, JCL, DB2, VSAM, and PL/I
Assume a PL/I program that wants to execute a call to an external procedure. This procedure expects 1 parameter and returns 1 parameter. Which instructions do you have to provide in the main program? (1) DCL MYSUB ENTRY (CHAR(5)) EXTERNAL; (2) DCL MYSUB ENTRY (CHAR(5)) RETURNS (CHAR(5)) EXTERNAL; (3) DCL MYPARAMETER,MYRESULT CHAR(5); (4) CALL MYSUB (MYPARAMETER); (5) MYRESULT = MYSUB; (6) MYRESULT = MYSUB(MYPARAMETER);
Calling an external PL/I procedure requires proper declaration and invocation syntax. You must declare the entry with RETURNS keyword if it returns a value, declare the parameter and result variables, and call it with the parameter in parentheses. The correct combination is ENTRY declaration with RETURNS, variable declarations, and function call syntax with parameter.