Generating code explanations
Generate detailed, AI-powered explanations that help you understand COBOL, JCL, PL/I, REXX, and Assembler programs. You can generate explanations either through a workflow or by using a prompt.
Generate a comprehensive explanation using workflow
To generate a comprehensive workflow-based explanation, complete the following steps:
- Open IBM® Bob workspace with all extensions installed.
- In the IBM Bob chat window, click the Start Workflow icon (Play button), select Explain code, and then click Start.
- Select the program file for which you need an explanation.
- Select an explanation perspective:
- Architect - Focuses on system design, integration points, and technology stack.
- Developer - Focuses on execution flow, processing steps, and technical implementation.
- Business - Focuses on business purpose, user interactions, and operational importance.
- The system retrieves data dictionary, validates dependencies, and generates a comprehensive explanation that includes purpose, interfaces, dependencies, and processing flow.
- The explanation is saved to docs/explain/<perspective_programname>.md.
Note: To view the flow diagram in the generated document, right-click the file and select
Open Preview.
Generate an explanation using a prompt
You can also generate explanations directly by typing a request:
- Open IBM Bob workspace with all extensions installed and select Z Code or Z Architect mode.
- In the chat window, use the
/explaincommand to generate an explanation for a program. For example:/explain {program_name}.cbl - The system automatically activates the
explainskill and creates a TODO list. - It checks for the data dictionary (DD.json) and retrieves the metadata. If unavailable, the
workflow continues without it.Note: For more information about the data dictionary, see Working with a data dictionary.
- The system identifies the required perspective based on the selected mode:
- Z code - Developer-focused, emphasizing execution flow, processing steps, and technical implementation.
- Z Architect - Architect-focused, emphasizing system design, integration points, and technology stack.
- The system displays a comprehensive explanation including purpose, interfaces, dependencies, and processing flow.
Note: Natural language prompts such as
explain what {program_name} does might
either start a workflow or trigger the explain skill to generate
explanations.Tools
To know about the tools used by IBM Bob Premium Package for Z to generate explanations, see Using workflows, skills, tools, and commands.
Sample prompts
You can use the following sample prompts to generate explanations:
- Explain what @{folder_name}{program_name} does
- Explain @{folder_name} {program_name}
- Explain the business logic in this code section
- Analyze this CICS transaction handler
- What does this JCL job do?