You can generate a Program, Screen, or Server either in Pacbase or in Rational Programming
Patterns (local generation). If you generate in Pacbase, you obtain a complete
generated code. This code includes both the code produced by the generation
of the design, and the code produced by the generation of the specific
insertions. If you generate locally, you generate the code produced
by the generation of the design only. Store the file produced by the Pacbase generation with
the design files (default), or in the COBOL target indicated on the Definition of
the generated instance. If you generate the instance locally, the PDP COBOL editor clearly
differentiates the specific code from the generated code. You can
then modify the specific code or add specific changes. You can also
modify the design and generate again. The generation process always
keeps your specific code, while taking all the design modifications
into account: This process is called the reconciliation.
Procedure
- If you
create a Program, Screen, or Server in Rational Programming Patterns,
you must perform the following actions:
- Specify its design in the dedicated design editor. You
open this editor by right-clicking the instance and select Open.
You can also double-click the instance.
- Generate it by right-clicking it and selecting (or , or ).
- You can also generate and work on a Program, Screen, or
Server that exists in Pacbase.
You must then perform the following steps:
- To see and modify its design in its dedicated editor,
you must have imported it from Pacbase or loaded it from
Rational Team Concert.
- You must generate the instance in Pacbase to obtain a fully
generated code. This code includes both the code produced by the generation
of the design, and the code produced by the generation of the specific
insertions.
- You must first see whether it calls Macros. If it does, you must
first generate these Macros in Pacbase. Generating the
Macro code is a prerequisite. You obtain a file that contains the
source of the Macro.
Note: The Dispatch Macros choice,
available from the contextual menu of the Design Explorer view,
enables you to import the Macro files into the location. If the files
contain the source of more than Macro, one source file is created
for each Macro.
- Then you must generate your Program, Screen, or Server in Pacbase and use one of the
following commands
- The automatic migration command, which performs a complete migration
(import, dispatch Macros, and so on).
- The migration help command,
- You must then generate the Program, Screen, or Server
design (.cbl file) in Rational Programming Patterns.
This generation is required and does not override the .cbl file
produced by the Pacbase generation.
To generate in Rational Programming Patterns, right-click it in the Design
Explorer view and select , or .
Note: The generated skeleton language of the instance
is identical to the Pacbase skeleton
language. This piece of information is retrieved from the extraction
of the Pacbase models
and from the import. It is stored on the Library.
After you
have generated in Pacbase and
locally, the generated code (which comes from the design) can be differentiated
from the specific code. Then you can always modify the design of an
instance which contains specific code. After generating the instance
again, the newly generated code will take into account the code produced
by the generation of the design, and will include the code produced
by the generation of the specific insertions. Moreover, the specific
code insertions will move to fit the new design at best. This process
is called the reconciliation.
Results
The generation produces the following files:
- A .cbl file, nested under the Program, Screen,
or Server instance in the Design Explorer view.
If you right-click it and select , the instances
involved in this file generation will be automatically displayed in
the References view.
- A map description file for a Screen (.map, .bms or .mfs),
nested under the Screen instance in the Design Explorer view.
If you right-click it and select , the instances
involved in this file generation will be automatically displayed in
the References view.
- A metadata file of the generated design (.cblpdp)
and a metadata file of the map for a Screen (.mappdp, .bmspdp,
or .mfspdp). These files can be viewed in the Package
Explorer view: They must not be edited but must be assigned
the same version number as the other generated files.
Important: These files are generated under the name indicated
in the COBOL program ID (for Programs) or Program
external name (for Screens and Server) of the Definition.
The name of the generated file can then differ from the instance name.
By
default, the generated files are stored with the corresponding design
files. However, you can indicate a root path to separate the generated
files from the design files in the generation project. You can also
change the generation project and folder. For information, see the
link which explains the generation target of a Program, Screen, or
Server.
To see and modify the generated code, right-click
the
.cbl file and select . You can then view the following
elements of the instance:
- its generated code in the PDP COBOL editor. This
editor offers additional functions, on top of the ones that are already
provided by the standard COBOL editor, which helps you modify the
code.
- its design as a hierarchical tree in the Design View.
Dedicated wizards help you modify the Program, Screen, or Server design.
- its generated nodes in the Generated Code Structure view
and accept or reject the choices made by the reconciliation.
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.
Note: Some micropatterns
and snippets, which are microgenerators, make it easier to enter some
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 menu.
PDP then recognizes 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 perform the following actions
- Open the Design View. Modify the design,
save it and generate the instance again to trigger the reconciliation
- Then open 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).