Working with IMS programs
Z Refactoring Assistant supports IMS transactions with some limitations.
Limitations for Z Refactoring Assistant of IMS transactions
- 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
-
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 asNEWPGM.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 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.psbThese 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: - 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.
- 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 theWORKING-STORAGE SECTION
to theLINKAGE SECTION
, and update theUSING
clause of thePROCEDURE DIVISION
statement accordingly. For example, ifDBPCB
is used in a CALL statement, then it must be available in theLINKAGE SECTION
of the refactored program, and thePROCEDURE DIVISION
statement must be updated by specifyingDBPCB
as part of theUSING
clause. For example,PROCEDURE DIVISION USING LTERMPCB
,DBPCB
. - 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.