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. You must run the migration help function to migrate this
complete code to your local workspace. After the migration, the complete
source is available in your local workspace. The PDP COBOL editor clearly
differentiates the specific code from the generated code.
Procedure
- To generate
the COBOL of a Program, Screen, or Server that was created in Rational
Programming Patterns, you must carry out one of the following actions:
- Right-click a Program, Screen, or Server instance in the Design
Explorer view, the Keywords view,
or the result view of a design or reference search. Select Generate and
the entity type of the selected instance.
- Right-click anywhere in the COBOL code of a Program, Screen,
or Server instance that is opened in the PDP COBOL editor or in
the Generated Code Structure view. Select Generate
the code.
- Click
in the Design view
of the instance. To be able to do so, you must have previously generated
the instance a first time and opened its code in the PDP COBOL editor.
- Enter an rpp –generate command line
from a command prompt.
- To generate the COBOL of a Program, Screen, or Server that
exists in Pacbase,
you must carry out the following actions:
- 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.
- If the instance calls Macros, generate these Macros in Pacbase with the MIMA procedure.
You must then import the result file with the Macro dispatching function.
This function dispatches the Macro sources among the corresponding
Macros of the various projects in your local workspace.
- Generate the Program, Screen, or Server in Pacbase with the MIA1 (for
Programs), MIA2 (for Screens), MIA3 (for
TUI clients), or MIA4 procedure.
- Migrate the instance design into your workspace to see
and modify it in its dedicated editor. To do so, you must run the MIBA, MIBR,
or MIBJ procedure and import the result file.
Note: The
rpp --automaticMigration command runs a whole migration.
It successively runs the import, Macro dispatching, and migration
help commands.
- Use the migration help function (rpp --migrationHelp)
to migrate the instance code into the local workspace. This step is
mandatory because it produces all the files that are required for
a correct generation.
The migration help function copies
the Pacbase COBOL
into your workspace and generates it again locally. This generation
takes into account the code that is generated in Pacbase. It runs the local
generation and carries out the post-processing and code reconciliation.
It also produces the associated metadata file. This file contains
data that is required for a correct generation.
The migration
help function then compares the Pacbase .cbl file
with the locally generated file. If it detects differences other than
a difference in formatting or comment, it set warnings. You must validate
the resulting code. This result of the local generation is stored
in a sandbox. Its content will not replace the content of the .cbl file
that is already copied into your workspace unless you explicitly request
it.
Note: For the instances that are
imported from Pacbase, the skeleton language of the local generation
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 in the Library.
After you validate the migration help results, you can
work on the design or the code of the instance, and generate it again
to take your modifications into account.
Results
The local generation of a Program, Screen,
or Server produces the following files:
- A .cbl file that is nested under the Program,
Screen, or Server instance in the Design Explorer view.
If you right-click it and select , the instances
that are involved in the generation are automatically displayed in
the References view. For explanations on the
generated constants, variables, and functions, see COBOL description of a generated Program, Screen, or Server.
- A map description file for a Screen (.map, .bms,
or .mfs) that is nested under the Screen instance
in the Design Explorer 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 that explains the generation target of a Program, Screen, or
Server.