Rational Developer for System z, Version 7.6

The derivation principle

The derivation principle makes it possible to generate a referenced instance in a derived instance, without duplicating the instance's design. There are two derivation types: the Library subsitution and the Source inheritance. With the Library substitution, you can generate the referenced instance from various libraries. With the Source inheritance, you can generate the referenced Program or Screen which includes specific code ; the Cobol source (i.e. the generated code and the specific code) of the referenced instance becomes the generated code in the derived instance and you can then add specific code to it.

Library substitution

This derivation type is available from the following entities: Programs, Screens, Data Structures (for the generation of the Copybooks) and Dialogs (for the generation of the error messages).

An instance may have to be generated from different libraries. This is the case, for example, of a Program which must be generated for the CICS and IMS platforms. So, when you generate an instance, the generation parameters of the selected library are taken into account to generate a specific Cobol, adapted to the generation target.

But it is not advised to create a new instance and duplicate its design just to be able to indicate a different generation library and to generate the corresponding Cobol file.

Instead of duplicating the instance, you can create a derived instance, which does not contain the instance's design but only points to the instance which contains the design and to the generation library.

To create the derived instance, you must use the instance's creation wizard of the entity (for example, you use the Program's creation wizard to create an instance derived from a Program instance), fill in the required fields, check the Derive box, select Library subsitution and specify the instance the instance is derived from.

This new instance is displayed under the same entity as the instance it is derived from, in the same location of the Design Explorer view. If you double-click on it, you will see that it only contains the Overview tab (with the reference to the instance which contains the design and the reference to the generation library) and the Keywords tabs.

Then you just have to generate the derived instance, i.e. the design of the initial instance but with the generation parameters of the library selected in the derived instance. The generated Cobol file will be created, nested under this derived instance.

This way, you can keep as many Cobol files of the same instance as there as generation targets.

Source inheritance

This derivation type is reserved for entities in which specific code can be specified, i.e. Programs and Screens.

When a Program or a Screen is generated, the output source file contains both the generated code (which comes from the design) and the specific code.

The source inheritance principle consists in creating another source file, linked to the initial source file, with the initial source file constituting the generated code for this second file. In other words, the complete code (i.e. the generated and the specific code) which is contained in the initial source file constitutes the generated code in the second source file. Specific code can then be added in this second source file.

So from the same design of the same VA Pac instance, you can generate two source files with different Cobol code. And you can repeat this process from the second file, by generating a third file whose generated code corresponds to the complete code of the second file...

The derived instance is verty simple since it only contains one field, a reference to the generable instance (a Program or a Screen).

To create the derived instance, you must use the instance's creation wizard of the entity (for example, you use the Program's creation wizard to create an instance derived from a Program instance), fill in the required fields, check the Derive box, select Source inheritance and specify the instance the instance is derived from (this can be a Program, a Screen or a derived instance of Program or Screen).

This new instance is displayed under the same entity as the instance it is derived from, in the same location of the Design Explorer view. If you double-click on it, you will see that it only contains the Overview tab (with the reference to the generable instance) and the Keywords tabs.

When you generate a derived instance with the Source inheritance option, the followings steps take place:
  • The instance referenced by the derived instance is generated normally: the code is generated, followed by the reconciliation (process which integrates the changes in the design, while keeping any specific changes entered in the code) with this first source.
  • Then the source obtained after this first generation-reconciliation is passed on to the reconciliation process as the generated code for a second reconciliation, this time with the second source. This second reconciliation outputs the second reconcilied source code.

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)