Generating a Program, Screen, Server, Communication Monitor, or Folder

You can generate the COBOL code of a Program, Screen, Server, Communication Monitor, or Folder. If a Business Component-type Server is not included in a Folder, you must generate the corresponding service manager. From certain types of Servers, you can also generate single-view proxies that the Client will use to remotely activate the services of the Business Components from the graphical application. From a Folder, you can generate a multi-view proxy. This proxy contains a set of classes that are used to manage the Folder in a graphic application.

Before you begin

You can decide where the files are to be generated. Refer to the link about the target of the generated files for more explanations.
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.

The preference Structure checking before generation management, which is available from Window > Preferences > Pattern Driven Programming > Pacbase Patterns, checks that the nesting of subfunctions in the COBOL code is correct before the generation. By default, it blocks the generation if structure errors are detected.

Procedure

You can generate the COBOL code in different ways:
  • Right-click a Program, Screen, Server, Communication Monitor, or Folder 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 that is opened in the PDP COBOL editor or in the Generated Code Structure view. Select Generate the code.
  • Click Generate the code 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.
    Note: The Design view is deprecated. It will be removed in a future version.
  • Enter an rpp –generate command line from a command prompt.
From a Server, selecting Generate > Server generation generates the COBOL file of the service manager, beside the COBOL file of the Business Component, if the following conditions are met, in the following priority order:
  • The type of the Server (or Server Dialog if the value is inherited) is S: Business Component.
  • The LOCATION=FMCODE-ENVIRNAME option is present in the -GO Lines of the Business Component or of its Dialog. In this option, FMCODE is the Communication Monitor name and ENVIRNAME the environment name. The presence of LOCATION triggers the default recognition of the implicit SRVMGR=YES option (this option is not visible). The service manager is then generated by default.
  • The SRVMGR=NO option is not present in the -GO Lines of the Business Component or of its Dialog. The SRVMGR=NO option overrides the implicit SRVMGR=YES option.
A service manager must be generated (in version 9.6 and higher) for each Business Component that is not integrated into a Folder. This purely technical component manages the facilities that are handled by the Folder when a Folder is specified.

From a Server (except IT: Initialization/Termination Business Component and E: Error Message Server), selecting Generate > Proxy generation generates the proxy that can be used to manage the services of the Business Component on the Logical View in a graphic environment.

Results

A progress information message box is displayed until the generation is complete.

The local generation of a Program, Screen, Server, Communication Monitor, or Folder produces the following files:
  • A .cbl file that is nested under the instance in the Design Explorer view. If you right-click it and select References > Subreferences, 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.

To edit the generated .cbl file, right-click it and select Open with > PDP COBOL editor. You access the COBOL editor and views where you can work on the code.

The generation of a service manager produces a .cbl file under the Business Component in the Design Explorer view. This file is generated by default in a project and folder that are distinct from the project and folder of the .cbl file that corresponds to the generated code of the Business Component. If the generation project and folder are identical, the file names must be different. The name of the service manager is the name that is indicated in the External name of the service field. If this name is not indicated, the file name corresponds to the Business Component name.

The generation of a proxy produces a .txt file under the Server in the Design Explorer view. The proxy must then be integrated into the graphic applications so that the Client can activate the services on the Server.

Note: To know how to generate the multi-view proxy of a Folder, see Generating the proxy of a Folder or Folder View.

Feedback