Procedure pointers are data items defined by which of the following clause?
-
(1) USING PICTURE Clause
-
(2) The USAGE IS FUNCTION-POINTER clause
-
(3) The USAGE IS PROCEDURE-POINTER clause
-
(4) The USAGE IS FUNCTION-ADDRESS clause
To answer this question, the user needs to have knowledge about procedure pointers in COBOL.
Option A is incorrect because the USING PICTURE clause is used to define the picture of data items.
Option B is incorrect because the USAGE IS FUNCTION-POINTER clause is used to define function pointers, not procedure pointers.
Option C is the correct answer. The USAGE IS PROCEDURE-POINTER clause is used to define procedure pointers in COBOL. Procedure pointers are data items that store the addresses of procedures.
Option D is incorrect because the USAGE IS FUNCTION-ADDRESS clause is used to define a data item that stores the address of a function, not a procedure.
Therefore, the answer is:
The Answer is: C. (3) The USAGE IS PROCEDURE-POINTER clause.
In COBOL, a procedure pointer is a data item that holds the address of a paragraph or section within the PROCEDURE DIVISION (used with SET and CALL for indirect procedure invocation). Such items are defined using the USAGE IS PROCEDURE-POINTER clause in the data description entry. FUNCTION-POINTER is a related but distinct usage for pointing to functions/entry points rather than procedures, and 'FUNCTION-ADDRESS' and 'USING PICTURE' are not valid COBOL clauses for this purpose. So USAGE IS PROCEDURE-POINTER is the correct, standard COBOL syntax.