Working with IMS programs

Z Refactoring Assistant supports IMS transactions with some limitations.

Limitations for Z Refactoring Assistant of IMS transactions

Z Refactoring Assistant supports IMS transactions with the following limitations:
  • IMS transactions can be displayed in the closure graph, but the IMS database cannot be shown.
  • Identifying key conditions and slicing on programs that are part of IMS transactions work the same way as they do for CICS® transactions.
  • Check LINKAGE SECTION for additional limitations.

Steps after you refactor a COBOL program

After you refactor a COBOL program, follow these additional steps:
  1. Make a copy of the PSB file that is used by the main program and update the PSBNAME attribute with the name of your newly refactored program. For example, if the new program is called NEWPGM.cbl, name the new PSB file as NEWPGM.psb and set PSBNAME=NEWPGM inside the PSB file.

    If you are using VS Code extension, Z Refactoring Assistant attempts to download the PSB/DBD files and does the renaming step. However, if Z Refactoring Assistant cannot find the file, you still must manually download the file and rename it. Z Refactoring Assistant uses the settings that are shown in the image here to download PSB/DBD files.
    Figure 1. Download settings for PSB/DBD files
    PSB and DBD file download settings

    Using the default values for PSB as an example, Z Refactoring Assistant attempts to search and download the corresponding PSB file for a program PROG1234.cbl from ADDI, in the following order:

    ../PSB/PROG1234.asm
    ../PSB/PROG1234.psb
    ./PROG1234.asm
    ./PROG1234.psb

    These file paths are relative to the program's location.

    File download only happens when generating the COBOL service program, and there's some code block that contains IMS CALL CBLTDLI statements. The files are placed into the workspace under specific directories.

    Z Refactoring Assistant might bring down multiple PSB files for those original IMS programs, it only does the renaming steps for the first file only. Users must combine the contents of the files into the first file so there's a single PSB file corresponding to the generated program.
    Note: Regardless of a file's original file extension, Z Refactoring Assistant always saves the downloaded files with .asm extension.
    For more information, see the following help links:
  2. You can modify any additional requirements to the new PSB file. For example, remove any PCBs not used in the newly refactored program, and ensure the order of the PCBs aligns with the order declared in the program.
  3. Inspect the LINKAGE SECTION of the newly refactored program to verify if all the variables that are specified in the IMS call statements are available, if not, move them from the WORKING-STORAGE SECTION to the LINKAGE SECTION, and update the USING clause of the PROCEDURE DIVISION statement accordingly. For example, if DBPCB is used in a CALL statement, then it must be available in the LINKAGE SECTION of the refactored program, and the PROCEDURE DIVISION statement must be updated by specifying DBPCB as part of the USING clause. For example, PROCEDURE DIVISION USING LTERMPCB, DBPCB.
  4. Inspect the PROCEDURE DIVISION of the newly refactored program. If you find multiple ENTRY statements that are generated, you must edit them into a single statement.
    Note: There might be multiple ENTRY statements because it is possible to bring in code blocks that originate from different IMS programs. Hence, those programs have ENTRY statements that Z Refactoring Assistant will bring into the generated code.