PDP COBOL editor
The PDP COBOL editor complements the functions of the standard COBOL editor. You can modify the COBOL code while clearly seeing the origin of all the code lines (generated lines or specific code lines for example), the deleted or overwritten lines, and the potential problems. To easily navigate in the code, you can use the Generated Code Structure view, which displays a hierarchical tree with the generated nodes of the instance.
For explanations on the variables and functions that are generated in the code, see COBOL description of a generated Program, Screen, or Server.
Composition of the PDP COBOL editor lines
In the PDP COBOL editor, the code lines are constituted of two parts that are separated by a vertical line. The first part is the line code itself. The second part, which starts from column 73, displays information that varies according to the origin of the code line.
- The name of the Program, Screen, or Server for the lines that are generated from the instance design and from the micropatterns present in the called Macros.
- The name of the Macro for the generated lines of a Macro.
- The identifier of the micropattern call in the lines that are generated from a micropattern insertion in the specific code of a Program, Screen, or Server. The identifier is automatically generated upon the generation of the Program, Screen, or Server to differentiate the calls. This identifier corresponds to the order number of the call. The identifier of the first micropattern call is 000001 and this number is incremented by 1 for each new micropattern call.
- A DOT annotation that replaces the level 99 that was indicated in the Pacbase Macros. You must not delete it because, upon generation, it adds a dot at the end of the previous significant line.
- A dot annotation that replaces the 99BL notion that was indicated in the specific code of the Pacbase Programs, Screens, or Servers. You must not delete it because, upon generation, it adds a dot at the end of the previous significant line.
- A COA annotation for the specific code lines that contained a COA operand in Pacbase.
- The level of the function or subfunction on the tag line of a function or subfunction that is inserted in the specific code of the Program, Screen, or Server, or in the called Macro. The level is displayed as lvnn, where nn is the level number. The level is not displayed on the functions or subfunctions that are generated from the design of the Program, Screen, or Server.
You can enter some information from column 73. You can manually insert a subfunction with a level. You can also enter a DOT to add a dot at the end of the previous significant line, for example if the previous line comes from a Macro.
Modifying the generated code
You can modify the generated code to adapt it to your particular needs.
You can use micropatterns or snippets to insert code. It is strongly recommended not to modify the code that is generated by a micropattern. Warnings in the margin indicate where the insertion of specific code can disrupt the reconciliation. Such is the case if you override a line that is generated by a micropattern and add a micropattern call in the specific code that is generated by a micropattern.
You can dispatch Macro lines inside a specific code block. To do so, you must frame the specific code lines with tags. A block that must be located before a Macro line must start with a line that contains the tag *{BEFORE FFFSSLIN (where FFSS is the function or subfunction code and LIN is the line number) and end with a line that contains the tag *}. A block that must be located after a Macro line must start with a line that contains the tag *{AFTER FFFSSLIN and end with a line that contains the tag *}.

If you right-click anywhere in the view, you can select Generate the code in the contextual menu. If you have updated the design of a Program, Screen, or Server, the newly generated code will integrate the changes in the design, while keeping any specific changes in the code.
The preference Structure checking before generation management, which is available from , checks that the nesting of subfunctions in the COBOL code is correct before the generation. By default, it blocks the generation if structure errors are detected.
Creating or updating specific functions or subfunctions
These actions are possible in the Pacbase facet only.
You insert functions or subfunctions in the PROCEDURE DIVISION. To open the creation wizard, right-click in the editor and select
. The cursor position when you open the wizard is irrelevant. The new function or subfunction is correctly inserted according to the number you give it in the wizard.- Insertion in absolute mode in Programs, Screens, and Servers,
- Insertion in relation to the automatic functions of the Standard or client
Dialog or Business Component model.Attention: In this Rational Programming Patterns version, relative insertions in the PDP COBOL editor are possible only through the high-priority Macro that is associated with the Screen or Business Component. This Macro is identified by the instance name, followed by SP. For example, if you want to insert a relative function or subfunction in the SCR001 Screen, you must do it in the SCR001SP high-priority Macro.
- The title of the function or subfunction,
- The start and end tags,
- The level,
- The comment *<insert code for Fffnn here> (with Fffnn as the function or subfunction code) to indicate the possible beginning of a specific code insertion,
- The execution condition if it was indicated in the wizard. This condition is added at the end of
the comment line that precedes the insertion (*.DU for example).Note: For explanations on the DO and CO execution conditions, see Particular cases of the DO and CO loops.
You can modify the title or level of a specific subfunction from the subfunction creation wizard. To do it, set the cursor inside the function or subfunction, right-click, and select
.Desynchronization between the design and the generated code


Specific display of the PDP COBOL editor
The PDP coloring complements the standard COBOL editor coloring to identify the origin of the lines. By default, Macro lines are khaki (Pacbase facet). The code lines that are generated from the design are gray. Micropattern declaration lines are pink and the code lines that are generated from micropattern insertions are blue. Moreover, by default, the start and end tags of the Pacbase functions and subfunctions in the specific code and the code from the Macros have a special color and are in bold.
You can change these PDP default colors by selecting .
is displayed if code lines were deleted or overwritten. If you place your mouse over this symbol, you can see the deleted line or the line that was overwritten by the current line.
is displayed in the following cases:
- On the lines where the reconciliation detects a potential problem. The
reconciliation is the process that integrates, after a generation, the new design of an instance
with the user-specific changes. A warning is displayed, for example, when the reconciliation is not
sure where it must place the specific code because several places are possible, or when the
overwritten generated code has changed. These warnings have a PDP Reconciliation
Marker type in the Problems view.
In the Pacbase facet, quick fixes are available for the reconciliation warnings that indicate that the user code cannot be carried over because its initial position no longer exists.
- On the lines where a difference is detected between the Pacbase generation and the local generation (Pacbase facet). For explanations on how to manage the Rational Programming Patterns warnings, see Managing the warnings in the Problems view or the PDP COBOL editor and Managing the warnings in the Validation Manager view.
- On the lines where a micropattern has set a warning.
- On the PROCEDURE DIVISION tag if Macro lines are overridden in the PROCEDURE DIVISION, or on the first line of the COBOL code if Macro lines are overridden outside the PROCEDURE DIVISION. Macro lines are overridden if they are present in two Macros, or if a Macro is called more than once in the same position.
- On the PROCEDURE DIVISION tag of a Server if the position of a subfunction after a Macro merge seems to be abnormal. The warning asks you to verify the subfunction position.
- On the lines where the reconciliation detects a potential problem. The
reconciliation is the process that integrates, after a generation, the new design of an instance
with the user-specific changes. A warning is displayed, for example, when the reconciliation is not
sure where it must place the specific code because several places are possible, or when the
overwritten generated code has changed. These warnings have a PDP Reconciliation
Marker type in the Problems view.
is displayed, in addition to the warning symbol
, for the reconciliation and migration warnings. It indicates that quick fixes are available directly in the PDP COBOL editor. To display them, click the symbol. You can also display the quick fixes by right-clicking one of the lines with the warning and by selecting Quick fix, or by clicking one of these lines and by selecting .
- Insert the user code
- Insert the user code with its context here
- Leave the code as is (Remove the problem)
- Insert the specific code lines of the initial Macro where they used to be.
- Insert the specific code lines of the initial Macro and their context to maintain the COBOL code consistency.
- Leave the code as is. The specific code lines of the initial Macro are removed.
In some cases, you must reinsert the specific code lines manually in the right place.
Such is the case when Macro tags have been modified (subfunction code or line number). The Problems view then displays a warning for each block of misplaced specific code.
- Move the cursor to the warning. To do that, double-click the warning in the
Problems view. You can also access the warning directly in the PDP COBOL editor. In both cases, the warning symbol is adorned
with the quick fix symbol
.
- Click the warning. The list of the quick fixes is displayed. Double-click Insert the user code with its context here. The specific code block is inserted.
- Cut and paste the lines to move them to the right place. In the Problems view, the line number of the warning is modified.
- Click the warning and double-click the quick fix Leave the code as is (Remove the problem). The warning is then removed.
If specific code blocks must be split into several blocks and inserted in several places in the generated code, you must solve the problem manually. Select the quick fix Leave the code as is (Remove the problem) and move the specific code blocks manually to their appropriate places.
You can change the display in the PDP editor with filters from the Generated Code Structure view.