You can generate a Pac Program or a Pac Screen either in VA Pac
or in RDz. If you generate a Program/Screen in VA Pac, you obtain a complete
generated code, which includes the design and the specific code. If you generate
a Program/Screen in RDz, you generate the Program/Screen 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/Screen 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/Screen in RDz,
you specify its design. in its dedicated design editor of the
Design
explorer view of the
Design perspective (you
open this PDP editor by right-clicking on the Program/Screen instance and
select
Open. You can also double-click on the Program/Screen
instance). Then:
- You must generate the Program/Screen in the Design explorer view
by right-clicking on it and selecting (or ). The generation outputs a .cbl file,
nested under the Program/Screen instance. This file contains the Program/Screen
design.
- To see and modify the generated code, click the '+' symbol in front of
the Program/Screen to expand it and right-click 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/Screen. The next operations are explained below, from step 4.
You can also generate and work on a Program/Screen which already
exists in VA Pac. You must then perform the following steps:
- If you want to see and modify the Program/Screen design in its
dedicated editor, you must convert the Program/Screen to the PDP model. To
do so, open the Pacbase explorer view, right-click on
a Program/Screen and select .
This Program/Screen
design then becomes available in the Design explorer view
of the Design perspective. Double-click on the Program/Screen
to display it in its dedicated editor. This conversion step creates a .pacprogram file
for a Program or a .pacscreen file for a Screen, 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/Screen in VA Pac, in order to obtain
a fully-generated code which includes the Program/Screen design and specific
code.
- You must first see whether the Program/Screen calls Macros.
If it does, you must first generate these Macros in VA Pac. Generating the
Macro code is required before generating the Program/Screen. 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 VA Pac 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 VA Pac 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/Screen 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 or pacscreen instance
has been created.
- You must then generate the Program/Screen design in RDz. This generation
is required and does not override the .cbl file output
by the VA Pac generation. To generate a Program/Screen in RDz, right-click
on it in the Design explorer view and select or 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 VA Pac 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 or a Screen 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/Screen:
- 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/Screen 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 Generated
Code Structure view. Save the new code. If you want to restore
the originally-generated code, go the Generated Code Structure 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 flagged by the reconciliation.
You must correct the errors, and deal with the warnings (that is validate
or reject the choices made by the reconciliation).