Rational Programming Patterns for System z

Actions common to all models of PDP Macro editors

You can modify the COBOL code of a Macro in a PDP Macro editor, by using the menu in the Macro tags tree view. 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. The tasks common to all models of macro editors are presented here.

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.
The Macro tags tree view displays the structure of a Macro in the form of a tree. You can expand the tree items with the Expand all icon or collapse the tree items with the Collapse all icon. You can filter the tags tree items to show a view of the items you want to work on with the text-entry field (identified by 'type filter text' in figure 1). It is useful when the tags tree items are numerous.

The Macro editor view, gives you a dynamic view of the changes you make in the view.

Create a child tag

To create a child tag, select a node in the tags tree, right-click, and select Create a child tag. It opens a dialog box where you must enter the required values depending on the selected node. There are three possible cases:
  • You create a detail tag:
    For example, if you create a child tag from a selected <SOURCE> node, a line number is required. If you enter 100 in the Line number field of the dialog box, the created tag is <SOURCE100>.
    Figure 1. Line number choice
    The dialog box opens when creating a child tag from a Source node.
  • You create a child tag from a selected <IOSEC-FILECTRL> or <FILE> tag in the tags tree. Then the required value is a file code which must be two characters long:
    Figure 2. File code choice
    The dialog box opens when creating a child tag from a File node.
  • If you create a child tag from a selected <WORKING> or <SUITE-WORKING> node, you must enter a starting line and a line number:
    Figure 3. Position choice
    The dialog box opens when creating a child tag from a tag <WORKING> or <SUITE-WORKING>.
    Starting line
    In the Starting line field, the required value consists of two numeric characters.
    Line number
    In the Line number field, the required value consists of three numeric characters.

Rename tag

To rename a tag, select a tag in the Macro tags tree, right-click, and select Rename tag. In the wizard that opens up, you can modify the Subfunction code and the Line number.

Remove a tag

To remove a tag, select a tag in the tree, right-click, and select Remove tag. As a result, the line is deleted from the tags tree and you can see in the editor that the line has been deleted.

Regroup tags

You can regroup detail lines in your Macro. The selected lines are grouped on the first tag of the selection.

  1. Select lines (for example 100, 200 and 250) in the body of a function with the Shift key, and right-click to select Regroup tags:
    Figure 4. Regroup tags choice
    Regroup tags choice
  2. As a result, you find the following structure in the tags tree:
    Figure 5. Tags regrouped on the first tag of the selection
    Tags are regrouped on the first tag of the selection

Update level

You can modify the level of a function or subfunction from the Macro tags tree:
  1. Right-click a function or subfunction and select the Update level choice.
  2. In the dialog box that opens, enter a value in the Level field:
    Figure 6. Update level
    Enter a new value in the level field.

As a result, the functions or subfunctions are set according to the dependent levels.

Create a linkage or a working

You can create a working only in a standard tags tree view, this choice is not available in the menu if you edit a skeleton in the tags tree. To Create working:
  1. Right-click in the tags tree where you want to insert a working and select Create a working or a linkage.
  2. In the dialog box that opens, enter a starting line and a line number.
Starting line
In the Starting line field, the required value consists of two numeric characters.
Line number
In the Line number field, the required value consists of three numeric characters.

According to the value defined for the starting line, the tag is positioned in the appropriate place. It can produce a linkage if a 'Linkage' tag exists and if the position entered in the Starting line and Line number fields is greater than that of the linkage.

Generation/no generation

With this command, you can put a tag on functions you want to generate. Right-click a function and select no generation/generation. A tag SUP tag is displayed on the left side of the function node. If you right-click a function tagged for generation, and select no generation/generation, the tag is removed and the function is not generated.

Create a function or subfunction

You can create new functions and subfunctions. Select a line in the Macro tags tree and right-click to select Create function or subfunction. In the dialog box that opens, complete the fields with the appropriate values.
Wizard to help you create a function/subfunction
Function code
The function code is mandatory. It must be two characters long.
Subfunction code
The subfunction code is optional. It is only required if you want to create a subfunction. It must be two characters long.
Level
The level value is optional, it must be two characters long. Numeric characters are required, except if the level starts with the $ value, in that case, the second character can be alphanumeric. If no value is entered in this field, it is automatically set to 05 for a function and to 10 for a subfunction.
Other possible levels for a subfunction range from 06 to 98.
Within a given function, a 15-level subfunction is part of the 06- to 14-level subfunctions which precede it. In other words, a subfunction of a logically lower level has a greater level number. A dependent subfunction is executed only if its higher-level (sub)function is executed. 99 is used to write a condition without changing the subfunction code. This condition applies until the next occurrence of a 99 level or until the end of the subfunction. A 99 level procedure is limited to 75 lines. A subfunction can contain a maximum of 98 - 99 levels.

Create a detail line in procedure division

This option is available in the tags tree only if you edit a skeleton. In the dialog box that opens, enter a function code, a subfunction code and a line number.

Override a tag

This choice is available in the tags tree only if you edit a skeleton. To override a tag, move your cursor to a node in the tree, right-click, and select Override tag. This action is possible only on some of the tags depending on the selection context:
Figure 7. Override a tag
Override a tag choice

Create the linkage section

This choice is available in the tags tree only if you edit a skeleton. You create a linkage from a selected <DATA> tag. Then in the dialog box that opens, you must indicate the position of the linkage:
Figure 8. Position choice for a linkage
The dialog box opens when creating a linkage from a <DATA> tag
Starting line
In the Starting line field, the required value consists of two characters, which must be numeric if it does not start with the $ value.
Line number
In the Line number field, the required value consists of three characters, which must be numeric if it does not start with the $ value.

Copy/paste tags

Tags can be copied and pasted with their text from a Macro to another one or within the same Macro.
  • Copy/Paste tags from a Macro to another one:

    You must copy all the tags, with their dependencies. When a tag already exists, a warning message is displayed and ask you to confirm the overriding of the tag.

  • Copy/Paste tags within a Macro:
    • in the window which opens, you must enter a new name,
    • only selected tags are copied.
  • The action Copy is inactive:
    • for tags in a skeleton and for tags 'comment', 'body' and 'fn',
    • when several tags are selected, if one of these tags have a type 'comment', 'body' or 'fn'.
  • The action Paste is inactive if the content to paste is not compatible with the target.

Other actions

Other choices are available only with the dialog and client model or the server model. For more details, read the Creating specific dialog or client subfunctions and Insertion of specific code in a Macro pages associated with this help page, by clicking the Associated references link.
Important: 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 a Macro have been modified, the program must be generated again.

Terms of use | Feedback

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