Micropatterns with a strong added value

These micropatterns are used to manage complex operators for the specific code. Their generation depends on the context. They act as microgenerators. You enter them in the COBOL code of an instance with the PDP COBOL editor, or in the code of a Macro with the Macro editor. When the instance is generated again, they are recognized and are expanded with information fetched from the instance design or from the use context.

Note: Micropatterns with a strong added value are also available as snippets. Snippets display a wizard to specify the declaration lines of the corresponding micropatterns. They are available from the Snippets view, in the RPP snippets or RPP Macro snippets category

To be recognized, a micropattern must be entered as a comment with a special format. It must include a start tag, an identifier, and the content lines themselves. The identifier and the content lines are specific to each micropattern.

Micropatterns are divided into two types:
  • Local micropatterns, which are expanded where they have been inserted (micropatterns for internal resource calls for example)
  • Global micropatterns, which are expanded in several places of the code, not necessarily where they have been inserted (date formatting micropattern for example)
The code generated from the micropattern is automatically updated upon each generation if the following conditions are met:
  • The formatted comment lines that constitute the micropattern have been updated.
  • The design element of the instance that is called in the micropattern has been modified (for example: if the internal format of a called Data Element has been changed).
You can specify micropatterns in the following generated COBOL files:
  • The .cbl file of a Program, Screen, or Server. When the instance is generated again, the micropatterns are kept in the COBOL code as they have been entered, with the start tag. The micropattern lines are expanded at the end of the reconciliation.
    Note: The reconciliation is the process which, after a generation, keeps the specific code while taking all the design modifications into account.
  • The design file of a Macro. When a Program, Screen, or Server is generated, its Macros must be generated first. They are then merged with the generation result of the calling Program, Screen, or Server. So when Macros are resolved, the characters that designate the micropatterns start tags are removed from the COBOL code. Only the generated expanded lines are kept. The micropattern lines are expanded just after the generation (and after the merge) and just before the reconciliation.

Feedback