You can generate a Program, Screen, or Server either in Pacbase or in Rational Programming
Patterns for System z (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
for System z, you must:
- 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 which 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 .cblmsp file
which contains the tagged code of the Macro.
Use the Dispatch
Macros choice, available from the contextual menu of the Design
Explorer view, in order to import the Macro files into
the location. If the files contain the code of more than Macro, one .cblmsp file
is created for each Macro.
- Then you must generate your Program, Screen, or Server in Pacbase and
- Use the migration help function,
- Or manually put the generated .cbl file (with
a drag or a copy/paste) in the Rational Programming Patterns for System
z COBOL target. This target defaults to where the design files are
stored, but you can also indicate a COBOL target in the Definition tab
of the generated instance.
- You must then generate the Program, Screen, or Server
design (.cbl file) in Rational Programming Patterns
for System z. This generation is required and does not override the .cbl file
produced by the Pacbase generation.
To generate in Rational Programming Patterns for System z, 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:
- A .cbl file, nested under the Program, Screen,
or Server instance in the Design Explorer view.
- For a Screen, the map description file (.bms, .mfs,
or .map), nested under the Screen instance in
the Design Explorer view.
- The metadata file of the generated design (.cblpdp)
and of the map (.mappdp). These files can be
viewed in the Package Explorer view.
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 instance:
- 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.
- Design as a hierarchical tree in the Design View.
Dedicated wizards help you modify the Program, Screen, or Server design.
- 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
- Go to the Design View. Modify the design,
save it and generate the instance 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).
Note: The PDP COBOL System z LPEX
editor is still available but it is advisable to use the PDP COBOL editor.