Generating refactored service programs

Generate a service program with the same functionality using the Markdown output containing all extracted code blocks from the extract relevant sections of code flow.

The Generate Refactored Service Program workflow follows the Refactor COBOL or PL/I program workflow.

Using this workflow, you can:

  • Generate a service program using extracted code blocks
  • Summarize what was refactored in a report

Prerequisites

  • A connection to Z Understand is required for extracting relevant sections of code.
  • Ensure the application project in Z Understand is built and ready.
  • Verify that the application source code is available in the local workspace.
  • Verify that you are working in Z Code mode.
  • An output -service.md file from the Refactor COBOL or PL/I Programs workflow.

Initiating the workflow

Open the workspace where the COBOL files and copybooks, or PL/I files and their corresponding PL/I include files are saved. Use one of the following approaches to initiate a refactoring workflow:

  • Bob automatically initiates the Generate Refactored Service Program workflow after completing the Refactor COBOL or PL/I Programs workflow.
  • You can also initiate this workflow by clicking the Start Workflow icon (Play button), selecting the Generate Refactored Service Program option and clicking Start.
  • Alternately, right-click on a -service.md file, select the Generate Service Code option from the IBM Bob Premium Package for Z menu.

Bob initiates the workflow in the chat window and prompts you to select the output -service.md file from the Refactor COBOL or PL/I Programs workflow.

Use the Browse file option to browse and select the Markdown file in the Program file box. Click Continue with selection. Bob confirms the file selection.

Note: After you initiate a workflow, at several stages, Bob prompts you to approve tools usage. You can either approve all tools for the task at a time by selecting Approve <tool type> tools for this task, or approve the tools after evaluating at each stage by selecting Approve once from the drop-down list.

Generating the service program

Bob validates the content of the selected Markdown file and proceeds to generate the refactored service program using extracted code blocks.

After generating the service program, Bob prompts you to specify whether you want to generate the extraction report. Select one of the following options:

  • Yes, generate the report - Click to generate a report with complete details of the code extraction.
  • No, I'm done - Click to end the workflow.

Generating the extraction report

You can also generate an extraction report by running the /refactor-report-generation skill after the code generation. This generates an extraction report (.md file) containing the following information:

  • Overview
  • Include Files Analysis Summary
  • Dependencies
  • Extraction Summary
  • What Was Extracted
  • Data Flow Analysis
  • What Was Not Extracted
  • Return Codes
  • Testing Considerations
  • Integration Guidance
  • Deployment Checklist