A micropattern is a group of lines you enter in the COBOL
code of an instance, using the PDP LPEX editor. When the
instance is generated again, these lines are recognized and are expanded
with information fetched from the instance design or from the use
context.
Using micropatterns enables you to organize the inserted lines
exactly as you want to in the COBOL code. You can group them in the
same place to make the COBOL code easier to read and maintain, or
sort them in a special order. The inserted micropatterns are kept
in the COBOL code unless you remove them explicitly.
To be recognized, a micropattern must be entered as a comment with
a special format; it must include a start tag, an identifier, the
content lines themselves, and an end tag. The identifier and the content
lines are specific to each micropattern.
Note: For explanations on
the input formats of the various micropatterns, click the links displayed
as the related reference below.
Micropatterns are divided into two categories:
- Local micropatterns, which add code where they have been inserted.
You can use such micropatterns to:
- Add internal resources (Data Elements or Data Structures) to a
Program, Macro, Screen or Server. When the instance is generated again,
these micropatterns are expanded with information fetched from the
repository.
- Manage, from a Macro, the iterations in the Program, Screen or
Server which calls this Macro. When the calling instance is generated,
these micropatterns are automatically expanded in the generated COBOL
code, according to the entity and the function in which they are inserted.
- Global micropatterns, which add code in several places, not necessarily
where they have been inserted.
The code generated from the micropattern is automatically updated
upon each generation if:
- The formatted comment lines which constitute the micropattern
have been updated,
- The design element of the instance 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:
- .cbl file of a Program, Screen or Server.
Once the instance has been re-generated, the micropatterns are kept
in the COBOL code as they have been entered, with the start and end
tags. The micropattern lines are expanded at the end of the reconciliation
(the process which, after a generation, keeps the specific code while
taking all the design modifications into account).
- .cblgen file of a Macro. When a Program,
Screen or Server is generated, its Macros must be generated first,
and they are then merged with the generation result of the calling
Program, Screen or Server. So when Macros are resolved, the characters
which designate the micropatterns' start and end 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.