The Micropattern Code entity

With this entity, you insert code lines by calling the Software Development Kit dedicated micropattern in the code of a COBOL Program, COBOL Copybook, or Source Code. When the calling instance is generated again, the micropattern call will be replaced with the specified code lines.

In the Micropattern Code, you declare micropattern fragments. Each fragment is constituted of an id that can be assigned one or more code lines. These code lines can contain parameters.

When you call the RPPMPF micropattern, which is dedicated to the Software Development Kit, in the code of a calling instance, you must indicate the fragment. If the code lines contain parameters, you must specify their value for this call. You can insert the micropattern from the Snippets view, under RPP SDK Micropattern Snippets.

In the generated code of the calling instance, the Micropattern Code is inserted in the following way:
  • The first line contains the following elements:
    • *!, which represents the beginning of the micropattern call. The * must be present in column 7, which is dedicated to the comments in the COBOL code, and the ! must be present in column 8.
    • The RPPMPF micropattern.
    • The details of the fragment to be inserted. Each value is indicated between double quotation marks, after an equal sign. The following elements are indicated:
      • The project and the package, if any, where the Micropattern Code is stored. If there is no package, "" is indicated.
      • The Micropattern Code name, which is indicated when the Micropattern Code is created.
      • The id of the inserted fragment, as it is defined in the Micropattern Fragments tab of the Micropattern Code.

      *!RPPMPF Project="myproj" Package="mypkg" Name="mpname" Id="fragmentid"

      where myproj is the project, mypkg is the package, mpname is the Micropattern Code, and fragmentid is the fragment identifier.

  • If the code line contains parameters, the values of these parameters are indicated on continuation lines in the following format:

    *- Param1="param1_value" Param2="param2_value"

When the instance that contains the fragment call is generated again, the code lines that are associated with the fragment id in the Micropattern Fragments tab of the Micropattern Code are inserted in the code. The insertion can take place at two levels, depending on the declaration of the code lines that are associated with the id:
  • If the code lines of the id are associated with a tag, they are inserted at the end of the tag. The tags are present in the Skeleton Source tab. If the Unique option is selected for the tag in the Micropattern Fragments tab of the Micropattern Code, the associated code lines are inerted only once, even if the Micopattern Code is called several times in the code.
  • If the code lines of the id are not associated with a tag, they are inserted where the RPPMPF micropattern is called. After the regeneration, the inserted lines are present in the Generated Code Structure view in the following format:

    RPPMPF_myproj_mypkg_mpname_fragmentid_nn

    where myproj is the project, mypkg is the package, mpname is the name of the Micropattern Code, fragmentid is the fragment id, and nn is the iteration number of the insertion, if the call is inserted more than once in the same code.

Feedback