Difficulty: Easy
Correct Answer: You write and save the COBOL source, compile it to produce an object module, link edit the object into a load module, and then execute that load module through JCL or another execution mechanism
Explanation:
Introduction / Context:
COBOL programs on the mainframe are generally compiled and linked into executable load modules before they can be run as batch jobs or online transactions. Understanding this build lifecycle is important for both developers and operations teams, because each stage can introduce errors and requires specific JCL steps or tool invocations. This question asks you to summarize the typical steps from writing source code to obtaining a runnable COBOL executable.
Given Data / Assumptions:
Concept / Approach:
The typical build process begins with editing and saving the COBOL source program. A compile step processes this source and generates an object module that contains machine level representations of the code but is not yet executable. A link edit or bind step then combines one or more object modules with required libraries to produce a load module, which is an executable image stored in a load library. Finally, that load module is executed by a batch job or by an online system such as CICS or IMS, depending on how it is invoked.
Step-by-Step Solution:
Step 1: Use an editor or development environment to create and save the COBOL source program in a source library.
Step 2: Run a compile job step that invokes the COBOL compiler, which checks syntax and generates an object module in an object library or temporary data set.
Step 3: Run a link edit or bind step that takes the object module and any needed libraries and produces a load module in the designated load library.
Step 4: Execute the load module either via a batch JCL step that references the program name or by defining it to an online subsystem such as CICS.
Verification / Alternative check:
Mainframe COBOL manuals and operations guides describe standard job streams with separate compile and link edit steps, often combined in a single procedure for convenience. The output of the compiler is an object module, and the output of the link editor is a load module. There is no indication that COBOL source runs interpreted or that JCL alone can generate programs, which confirms that the correct sequence is source, compile, link, then execute.
Why Other Options Are Wrong:
Option B is wrong because mainframe COBOL is compiled and not interpreted at runtime. Option C incorrectly suggests that JCL can create programs without source, which is not true. Option D reverses cause and effect by claiming you build a load module before compiling. Option E misstates that COBOL must be converted to Java, which is not a requirement for mainframe execution.
Common Pitfalls:
Common pitfalls include mismatched compiler and link options, placing the load module in the wrong library so that JCL cannot find it, and forgetting to recompile after source changes. Another issue is ignoring compiler listing messages that warn about potential logic issues. By following a clear sequence of writing, compiling, link editing, and executing, and by checking outputs at each stage, you can build reliable COBOL executables and troubleshoot build problems effectively.
Final Answer:
You write and save the COBOL source, compile it to produce an object module, link edit the object into a load module, and then execute that load module through JCL or another execution mechanism
Discussion & Comments