LIB compiler option must be in effect for which of the following statements?
-
(a) Basis
-
(b) Copy
-
(c) Replace
-
(d) All of the above
To understand which statement requires the LIB compiler option, one must know what the LIB compiler option does. The LIB compiler option specifies the name of the library file to be used during the linking phase of the build process. The library file contains precompiled object code that can be linked to the program being built.
Now, let's go through each option and determine whether it requires the LIB compiler option or not:
A. (a) Basis: This statement does not require the LIB compiler option because it does not involve linking precompiled object code from a library file.
B. (b) Copy: This statement does not require the LIB compiler option because it does not involve linking precompiled object code from a library file.
C. (c) Replace: This statement requires the LIB compiler option because it involves linking precompiled object code from a library file. The library file specified in the LIB option will be used during the linking phase of the build process.
D. (d) All of the above: Since option C requires the LIB compiler option, the correct answer is D, i.e., all of the above.
Therefore, the answer is: D.
In COBOL, the LIB compiler option must be in effect to use library-related source statements: BASIS (to bring in a base source program from a library), COPY (to include copybook members), and REPLACE (to substitute text when incorporating library text, often paired with COPY). All three statements involve pulling text from an external library into the compilation, which is exactly what LIB enables/governs. Since each of Basis, Copy, and Replace individually requires LIB, 'All of the above' correctly captures that the option applies to all three, not just one.