Comparing COBOL code in the compare editor
You can compare the content of COBOL files from the Rational® Programming Patterns compare editor, or from the Rational Developer for System z® (IBM® Developer for z Systems™) and Rational Developer for AIX® and Linux compare editor.
Some preferences apply to the COBOL compare editor. For example, you can indicate that the editor must not flag differences in the comments or in the EXIT statements. For explanations on these preferences, see the paragraph "COBOL comparison" in the Preferences on the Pacbase patterns.
The Rational Programming Patterns COBOL compare editor complements the functions of the Rational Developer for System z (IBM Developer for z Systems) and Rational Developer for AIX and Linux editor. However, it includes some restrictions.
- The Design Explorer view. You can then compare two local files. To open the COBOL compare editor, complete the following steps:
- Click a local .cbl file.
- Press Ctrl and select another local .cbl file in the same view and the same stream.
- Right-click and select .
The COBOL compare editor opens. Make sure that you see the files through the PDP Generated Code Compare editor. You can then benefit from the following features:- The two compared files are in edit mode. You can then copy and paste lines in both directions.
- The colors that are specific to each line type are shown in both files. You can then easily see where the lines come from: generated code, specific code, Macros, or micropatterns. For explanation on the line colors, see Preferences on the Pacbase patterns.
- The contextual menu of both files in the editor contains the Generate the code choice to generate the code again after updates and see the result directly in the compare editor.
- The Pending Changes view. You can then compare a local file with its
remote version in the stream.
To open the COBOL compare editor, click a .cbl file, or right-click a .cbl file and select Open in Compare editor.
The COBOL compare editor opens. Make sure that you see the files through the PDP Generated Code Compare editor. You can then benefit from the following features:- The local file is in edit mode, whereas the remote file is in read-only mode. You can then copy and paste lines from the remote file to the local file.
- The colors that are specific to each line type are shown in both files. You can then easily see where the lines come from: generated code, specific code, Macros, or micropatterns. For explanation on the line colors, see Preferences on the Pacbase patterns.
- The contextual menu of the local file in the editor contains the Generate the code choice to generate the code again after updates and see the result directly in the compare editor.
- The -CP Lines tab of a Program, Screen, or Server. You can then compare
the COBOL code before and after modifications in the Macro calls. To open the COBOL compare editor, complete the following steps:
- Open the -CP Lines tab of a Program, Screen, or Server
- Modify the Macro calls.
- Click Preview.
The calling instance is generated again and the COBOL compare editor opens so that you can see the impact of your modifications. You can also copy modifications from the previous COBOL code to the new COBOL code.
If you click Cancel in the compare editor, the new COBOL code is not saved and you can keep modifying the Macro calls. If you click OK, the new COBOL code replaces the previous COBOL code and the design of the calling instance is saved with the new Macro calls.
You can start the preview only if the following conditions are met:- A previous version of the COBOL code must exist for the calling instance.
- The existing COBOL code must not contain any migration warning.
- The existing COBOL code must be synchronized with the design of the calling instance.
- The existing COBOL code must not be currently opened in the COBOL editor.
- All the design editors must be closed, except the design editor of the calling instance that is being modified.
- Copying and pasting lines that come from micropatterns is strongly inadvisable because it can cause errors.
- It is not possible to compare files from two different streams.
- It is not possible to compare a local version with a version in the history.