You can generate a Pac Program either in Pacbase or in RDz. If
you generate a Program in Pacbase, you obtain a complete generated code, which
includes the design and the specific code. If you generate a Program in RDz,
you generate the Program design only. If you put both generations in the same
directory, in RDz, the Pattern Driven Programming function will clearly make
a distinction between the generated code and the specific code. You can then
modify the specific code or add specific changes. You can also modify the
Program design and generate again. The generation process will always keep
your specific code, while taking all the design modifications into account:
this is called the reconciliation.
If you create a Program in RDz, you
specify its design. in its dedicated Pattern Driven Programming editor of
the
Design explorer view of the
Design perspective
(you open this PDP editor by right-clicking on the Program instance and select
Open.
You can also double-click on the Program instance). Then:
- You must generate the Program in the Design explorer view
of the by right-clicking on it and selecting . The generation outputs
a .cbl file, nested under the Program instance. This
file contains the Program design.
- To see and modify the generated code, click the '+' symbol in front of
the Program and right-clicking on the nested .cbl file.
Then select in the popup menu.
- In the Pdp LPEX editor which opens up, you can add specific code to your
Program. The next operations are explained below, from step 4.
You can also generate and work on a Program which already exists
in Pacbase. You must then perform the following steps:
- If you want to see and modify the Program design in the dedicated
editor of the Pattern Driven Programming function, you must convert the Program
to the PDP model. To do so, open the Pacbase explorer view
of the Pacbase perspective, right-click on a Program
and select .
This Program design
then becomes available in the Design explorer view of
the Design perspective. Double-click on the Program to
display it in its dedicated editor. This conversion step creates a .pacprogram file
in the Navigator view of the Design perspective.
The
same applies to Macros, for which the conversion step creates a .pacmacro file
in the Navigator view of the Design perspective.
- You must generate the Program in Pacbase, in order to obtain a
fully-generated code which includes the Program design and specific code.
- You must first see whether the Program calls Macros. If it does,
you must first generate these Macros in Pacbase. Generating the Macro code
is required before generating the Program. You obtain a file which contains
the tagged code of the Macro. You must put this file (via a drag and drop
or a copy/paste) in the Navigator view of the Design perspective,
in the appropriate package (which corresponds to the Pacbase Database and
library). This file must have a cblgen extension. Modify
its extension if it is not the case.
Tip: If
the file which contains the output of the Pacbase Macro generation contains
the code of more than one Macro, you are advised to use the Dispatch
macros choice, in order to create one cblgen file
for each Macro. If you do not, the code of all the Macros contained in the
file will remain in this single file.
- Then you must generate your Program and put the generated .cbl file
(via a drag and drop or a copy/paste) in the Navigator view
of the Design perspective, in the directory where the
corresponding .pacprogram instance has been created.
- You must then generate the Program design in RDz. This generation
is required and does not override the .cbl file output
by the Pacbase generation. To generate a Program in RDz, right-click on it
in the Design explorer view of the Design perspective, and select in
the popup menu.
This step outputs a .cblpdp file
in the Navigator view of the Design perspective.
This file contains the metadata required by the Pattern Driven Programming
(PDP) editor.
Once you have performed both the Pacbase and RDz generations,
the Pattern Driven Programming function can differentiate the generated code
(which comes from the design) and the specific code. Then you can always modify
the design of a Program which contains specific code. After generating the
Program again, the newly-generated code will include the new design, while
keeping the specific code. Moreover, the locations of the specific code insertions
will be moved to fit the new design at best. This is called the reconciliation.
- To view the code and modify it, select the .cbl file
in the Design perspective and right-click. Select in the popup menu. You can then view the Program:
- Generated code in the PDP COBOL editor. This editor offers additional
functions, on top of those already provided by the standard RDz LPEX editor,
which help you modify the code.
- Design as a hierarchical tree in the Pac Design View.
Dedicated wizards help you modify the Program design.
- Generated nodes in the Generated Code Structure view
and accept or reject the choices made by the reconciliation.
- Structure in the Outline view.
All the inconsistencies, if any, found upon generation are listed
in the Problems view.
- If the generated code does not fully fit your needs, you must modify
it. Modifying the generated code includes inserting code in the generated
code, removing or overwriting parts of it. The changes you make in the generated
code are called specific changes. When you enter a specific change in the PDP
COBOL editor, this change is immediately visible in the Pac
Design View. Save the new code. If you want to restore the originally-generated
code, go the Pac Design View and select Restore
generated code in the popup menu. The Pattern Driven Programming
function will then recognize that the code corresponds to a generated code
and will gray the corresponding lines.
- To specify enhancements or correct bugs which require changes in
the design, you must go to the Pac Design View, modify
the design, save it and generate the Program again to trigger the reconciliation.
- Then go to the Generated Code Structure view
to see whether errors or warnings have been generated by the reconciliation.
You must correct the errors, and deal with the warnings (that is validate
or reject the choices made by the reconciliation).