Working with IMS programs

Z Understand supports IMS transactions that is applicable for COBOL only with some limitations.

Limitations for Z Understand of IMS transactions

Z Understand 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 Understand attempts to download the PSB/DBD files and does the renaming step. However, if Z Understand cannot find the file, you still must manually download the file and rename it. Z Understand uses the settings that are shown in the image here to download PSB/DBD files.

    Using the default values for PSB as an example, Z Understand attempts to search and download the corresponding PSB file for a program PROG1234.cbl from Z Understand, 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 Understand retrieves multiple PSB files for the original IMS program, but it only performs the renaming steps on the first file. Users must merge the contents of all the files into the first one to ensure a single PSB file corresponds to the generated program.
    Note: Regardless of a file's original file extension, Z Understand 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 PROCEDURE DIVISION accordingly. For example, if the LTERMPCB record structure name is used in a CALL to IMS Transaction Manager (TM), then the record must be available in the LINKAGE SECTION of the refactored program, and the refactored program is a sub-program that can be invoked. The PROCEDURE DIVISION statement must be updated by specifying the record as part of the USING clause, for example, PROCEDURE DIVISION USING LTERMPCB.
  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 Understand will bring into the generated code.