Advantage Automated Code Structuring for COBOL - Automate the Migration of Your COBOL Programs

Document ID : KB000055933
Last Modified Date : 17/02/2018
Show Technical Document Details

Introduction
Migrating a COBOL program to a different platform/environment requires that you clearly and easily separate the business logic code from the data logic code. The next sections describe how to separate the data logic code from the business logic code. In addition to isolating the data logic code, you can also isolate all of your CALL statements.

Advantage Automated Code Structuring for COBOL, formerly known as VISION:Recode, can be executed as a z/OS program or as a Recode Task within the Advantage Automated Code Manager Windows application.

Advantage Automated Code Structuring for COBOL is called Code Structuring in the remainder of this document.

CICS Command Isolation
When this option is selected, Code Structuring isolates the structured program's CICS commands, moving them to the bottom of the restructured Procedure Division for easy modification or reference. By isolating all CICS commands, you are provided a clear look at the scope and function of the program's CICS code. Code Structuring replaces each CICS in-stream command with a COBOL PERFORM statement and moves each command to a new performed procedure. These new procedures are located at the physical end of the structured Procedure Division, immediately following any Handle Targets that the program includes. Each new procedure is assigned a paragraph name that identifies it as a CICS paragraph, and reflects the function of its CICS command.

When this option is not selected, all CICS commands remain in-stream, generating a structured program whose commands are interspersed throughout the Procedure Division.

CICS270-RECEIVE-MAP.
*:-----------------------------------------*
*: PERFORMED BY B10
*:-----------------------------------------*
    EXEC CICS RECEIVE
      MAP ('CUST0000')
      MAPSET ('CUSTM00')
      INTO ('CUST000I')
    END-EXEC.

To request CICS Command Isolation in the z/OS environment, check 'Isolate CICS Statements' in the CICS OPTIONS ISPF panel.

To request CICS Command Isolation in the Windows environment, check 'Isolate CICS Statements' in the CICS/SQL/DLI tab.

DL/I Command Isolation
Isolating the structured program's DL/I commands is very similar to isolating CICS Command as described above. Each new procedure is assigned a paragraph name that identifies it as a DLI paragraph, and reflects the function of its DLI command.

To request DL/I Command Isolation in the z/OS environment, check 'Isolate DLI Statements' in the DLI OPTIONS ISPF panel.

To request DL/I Command Isolation in the Windows environment, check 'Isolate DLI Statements' in the CICS/SQL/DLI tab.

SQL Command Isolation
Isolating the structured program's SQL commands is very similar to isolating CICS Command as described above. Each new procedure is assigned a paragraph name that identifies it as a SQL paragraph, and reflects the function of its SQL command.

Regardless of the Isolate SQL Command setting, Code Structuring does not isolate the IF statements that it substitutes for WHENEVER statements. These equivalent IF statements are always left in-stream.

SQL WHENEVER Structuring
Code Structuring SQL language extension recognizes and graphs the implied control flow changes created by WHENEVER commands, and it structures these control paths without requiring the rewrite of WHENEVER commands.

WHENEVER statements function as implicit GO TO statements for every succeeding SQL statement. Therefore, to produce structured output, Code Structuring creates IF statements that test the value of SQLCODE for each SQL statement encountered under control of the WHENEVER command. This transformation mimics the behavior of the DB2 pre-compiler toward SQL WHENEVER commands.

Code Structuring flags the WHENEVER command and the SQL statements within its scope with a Warning Message, alerting that it has removed the WHENEVER and inserted functionally equivalent IF statements. In addition, Code Structuring documents structured WHENEVER commands with in-stream comments.

To request SQL Command Isolation in the z/OS environment, check 'Isolate SQL Statements' in the SQL OPTIONS ISPF panel.

To request SQL Command Isolation in the Windows environment, check 'Isolate SQL Statements' in the CICS/SQL/DLI tab.

I/O Command Isolation
Isolating the structured program's I/O commands is very similar to isolating CICS Command as described above. Each new paragraph name is composed of the INOUT prefix plus a numeric, followed by the I/O verb, followed by the record or file that is involved in the I/O (for example, INOUT270-WRITE-INREC).

To request I/O Isolation in the z/OS environment, check 'Isolate I/O Statements' in the Options ISPF panel 2.

To request I/O Isolation in the Windows environment, check 'Isolate I/O Statements' in the Prog. Structure 1 tab.

CALL Command Isolation
Isolating the structured program's CALL commands is very similar to isolating CICS Command as described above. Each new paragraph name is composed of the INOUTnnn prefixes, where nnn denotes a sequential numeric paragraph, followed by CALL, followed by the name of the subroutine that is being called (for example, INOUT270-CALL-ABEND).

To request CALL Isolation in the z/OS environment, check 'Isolate CALL Statements' in the OPTIONS ISPF panel 2.

To request CALL Isolation in the Windows environment, check 'Isolate CALL Statements' in the Prog. Structure 1 tab.