Rational Programming Patterns for System z

Modifying the code of a Macro

With the PDP editors, you are given the possibility to modify the COBOL code of a Macro easily, by using the options in the pop-up menu of the Macro tags tree view and identify quickly the different sections in a Macro. In this view, you can create tagged functions, subfunctions, and working sections to identify your code. The tags tree can be presented in the skeleton of a program retrieved from the model you select when you open the Macro. Some of the choices in the menu of the tags tree view are specific to a model and only displays if you open your Macro in the PDP Macro editor dedicated to the model in which it has been created.

Before you begin

To be able to open a Macro in a PDP editor, you must have a .cblmsp file in your location with your Macro.

About this task

Procedure

  1. A PDP Macro editor is to be opened from a MacroName.cblmsp file. This file is saved in the Design Explorer view if the Macro was created locally, or generated in Pacbase and imported into the Pattern Driven Programming perspective. A right-click a MacroName.cblmsp file and Open with > PDP Macro editor (batch model) for example, opens the PDP Macro editor which consists of an editor view and of a Macro tags tree view. There are several models available for the PDP editor, choose the one which corresponds to the type of Macro you want to open.
  2. If the Macro tags tree is empty, a message warns you that you need to create a tag in the tags tree view so that you can start inserting items. A pop-up menu in the view is the starting point for all the actions to be done in the Macro tags tree. You have the possibility to create standard actions which are common to all the PDP editors independently of the model chosen such as creating functions, a detail lines in a procedure division, creating a working storage section or linkage, organizing tags in the tree... You can also perform actions specific to the model in which your program was created, such as creating dialog subfunctions, updating parameters, or inserting specific code in a Macro.
    1. Create specific dialog or client subfunction. This choice is active in the pop-up menu of the PDP Macro editor for a dialog or client model only. You can create a subfunction from a tree tag with a skeleton view or with no skeleton view. Right-click in the tags tree and select Create specific dialog subfunction. It opens the Create a subfunction window in which you can enter the characteristics of the subfunction. The type of parameters which can be updated depends on the type of subfunction selected in the Function choice field. When all the parameters are completed, click OK . The tags tree displays the new subfunction before, after or in place of the selected subfunction depending on what is specified in the window. A new line is displayed in the Macro editor view for the new subfunction.
    1. Update parameters (dialog/screen or server specific): This choice is active in the pop-up menu of the PDP Macro editor for the dialog, screen or server model only. You can update the parameters of a subfunction from a tree tag with a skeleton or with no skeleton view. Right-click a subfunction and select the Update parameters choice. It opens the wizard which was used to create the function/subfunction. In this wizard, you can modify some of the parameters specific to the subfunction you have selected.
    1. Insert specific code in a Macro (server model): You can insert specific code at different level in the Macro which is called in a server, at the level of a general access, Logical View, Logical access or physical access. All these choices are available in the pop-up menu for a server model only.
  3. You can then insert your code directly in the Macro editor view, which is a window displayed above the tags tree view. You can identify clearly your code with the tags you have created.
  4. You can insert formatted comments which correspond to micropatterns. When the instance calling the Macro will be generated, these comment lines will be recognized and automatically completed. You can thus easily manage the iterations in a Program, a Screen or a Server.
  5. Tags are very important for the structure of a program. They are used to merge Macros, and to merge a Macro with a program. So, if the parameters of the Macro have been modified, the program must be generated again.

What to do next

Note: All the options available in the Macro tags tree are detailed in the reference pages associated with this help page.

Terms of use | Feedback

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