Types of code splitting
You can use the Code Splitter for procedure or file I/O splitting of a COBOL program.
- Procedure splitting creates an extract program that contains all information for a selected procedure and a complement program that contains the rest of the program. The extract program contains all COBOL statements for the selected procedure, code for related data, and all procedures invoked by the selected group.
Procedure splitting isolates specific pieces of source code logic. You select a procedure and the Code Splitter identifies the data and other procedures necessary to create a compilable program. These procedures are moved into an extract program. For Batch programs, the procedures are referenced in the complement program with static CALL statements. For CICS programs, the procedures are referenced with EXEC CICS LINK statements and associated DFHCOMMAREA code. The way referenced variables are handled depends on your program type. For Batch programs, the 01 level of the existing referenced variable is passed to the extract file without being renamed. For CICS programs, a referenced variable is passed to the extract program and renamed.
(Procedure splitting is available for CICS and Batch programs. In CICS programs, HANDLE statements are ignored. Procedures that are only performed as a result of a HANDLE statement will not be copied to the extract or complement program. Procedures containing IMS calls are not supported.) If the procedure or any of its subordinate groups contains I/O, you will not be able to split the program by procedure.
- File I/O splitting moves all file references from the current program into a separate program. This can be useful to help identify and remove environment-specific code from a program. File I/O splitting creates a complement program that is free of file I/O statements and one or more extract programs that contain all I/O statements for a file. The Code Splitter creates an extract program for each SELECT statement in your program. Frequently, an I/O split results in a complement program that can be split by procedure.
A file I/O split will only split files defined with a file description (FD) in the File Section. SQL statements will not be treated as I/O. (File I/O splitting is available for Batch programs only.)
Code splitting type | Starting program | Result |
Procedure | Original program | Complement program |
File I/O | Original program | Complement program |
Related topic