-CP Lines tab
The purpose of this tab is to call one or more Macros into a Program, Screen, Server, Folder, or Communication Monitor (or associated Dialog). If these Macros are parameterized, you must also specify the values of their parameters. Each occurrence of the parameter in the original Macro is then replaced by the value that is entered for this particular calling instance.
- A table with the Macros that are called in the instance. Each line corresponds to a Macro call.
Macros are displayed in the alphabetical order. If a Macro is called more than once, its various calls are sorted according to the line numbers.
The line number is present in the Line number column of the table and in the Line number field of the Macro call section. It can be entered and modified in either place. If the line number is 0 in the Macro call section, no value is displayed in the Line number column. If a Macro call contains an error or a warning, you can easily spot the problematic line with the line number that is included in the message. The line number is constituted of two numeric characters. When a Macro is parameterized, the line number is used to call the Macro more than once into the same calling instance.
If the called Macros contain parameters, each parameter is followed by its value in the calling instance.
You can double-click a Macro call to open it in the Macro editor in the context of its call.
You can export the table content to a .CSV file and exploit the results in a spreadsheet program. To do so, right-click a Program in the Design Explorer view and select Export the descriptions. The export wizard displays the descriptions that can be exported: -CD Lines and -CP Lines. Select a description or both descriptions. Browse to select an output folder that will contain a file for each exported description. The file is named P_program_CD_project.csv, where program is the Program name, CD is the description (CD or CP), and project is the project name.
To complete or modify the table, you can use the associated buttons. You can also right-click to display the contextual menu. You can do the following actions:- Add one or more Macro calls. In the selection wizard that opens, you can select contiguous or non-contiguous Macros.
- Remove one or more Macro calls.
- Generate the calling instance again after you modify Macro calls. You start generating by
clicking Preview. When the generation is complete, the Rational® Programming Patterns COBOL compare editor opens automatically. It
compares the new generated COBOL code with the previous COBOL code. You can then check the impact of
your modifications in the Macro calls. You can also copy modifications from the previous COBOL code
to the new COBOL code.
If you click Cancel in the compare editor, the new COBOL code is not saved and you can keep modifying the Macro calls. If you click OK, the new COBOL code replaces the previous COBOL code and the design of the calling instance is saved with the new Macro calls.
You can start the preview only if the following conditions are met:- A previous version of the COBOL code must exist for the calling instance.
- The existing COBOL code must not contain any migration warning.
- The existing COBOL code must be synchronized with the design of the calling instance.
- The existing COBOL code must not be currently opened in the COBOL editor.
- All the design editors must be closed, except the design editor of the calling instance that is being modified.
You can search among the parameters values. To do so, the Macro calls table must have the focus. Right-click the table or select Find, or press CTRL + F. The search wizard opens. Enter the character string to be found, select the direction and the scope of the search. If you limit the search scope to selected Macro call lines, you must select the lines before you start the search. Click Find to start the search. The first parameter whose value corresponds to the search criteria is highlighted in the parameters table and the Macro call is highlighted in the Macro calls table. To find the next occurrence, click Find again.
You can replace a Macro call with another Macro call directly from the Macro column. The line number and the parameters of the initial Macro are kept. This action is not recommended because it can cause inconsistencies when the calling instance is generated again. However, if you must do it, you must select a new Macro whose content is close to the content of the initial Macro. You must always verify the generated code after the replacement.
Two methods are possible:- Place the cursor in the column and enter the name directly. To make the input easier, you can open a content assist wizard by clicking Ctrl and the space bar simultaneously. If you start entering a name, the content assist displays the instances that start with this input. If you enter the name of an instance that does not exist and if you validate, the input is discarded.
- Click the button that appears when you set your cursor in the column. In the selection wizard that opens, select an instance.
- The Macro call section. To display the content of this section, you must
select a Macro call in the table. This section contains the following elements:
- The line number.
The line number is present in the Line number column of the table and in the Line number field of the Macro call section. It can be entered and modified in either place. If the line number is 0 in the Macro call section, no value is displayed in the Line number column. If a Macro call contains an error or a warning, you can easily spot the problematic line with the line number that is included in the message. The line number is constituted of two numeric characters. When a Macro is parameterized, the line number is used to call the Macro more than once into the same calling instance.
- An optional comment on the call.
- An Add button that you can click to add 10 parameters to the first 10 parameters that are initially displayed.
- A table that displays all the possible parameters, and their corresponding values for the
parameters that are called in the Macro. There are two types of values:
- A simple character string. Enter the value in the Value column. The number of characters that is used for each parameter value must correspond to the appropriate field length for the parameterized element. For example, if $1 is used as a function code, the value must be 2 characters long.
- A Data Element, a Data Structure, or a Segment. Proceed according to one of the following
methods:
- Click the Linked entity column and click the selection button that is displayed then. Select the instance in the selection wizard.
- Enter the instance name directly in the Linked entity column. To make the input easier, you can open a content assist wizard by clicking Ctrl and the space bar simultaneously. If you enter the beginning of a name before you open the wizard, the instances that start with this input are proposed by the content assist. It displays, in the order, the Data Structures, Data Elements, and Segments. If you enter 4 characters that correspond both to a Data Element and a Segment and if you validate, the Data Element is displayed in the column. If you enter 2 characters that correspond both to a Data Element and a Data Structure, the Data Element is displayed in the column. If you enter the name of an instance that does not exist and if you validate, the modification is not effective.
The instance name is also automatically displayed in the Value column. It is preceded by E= (for a Data Element), D= (for a Data Structure), or S= (for a Segment). When the calling instance is generated, the parameter is replaced by the instance name and references are automatically created.
Note: The parameter values can be modified in a centralized way from the Macro cross-references view for all the instances that call the Macro.Two protected technical Macros, ££USER and ££80EX, can be called from the -CP Lines of Business Components.
These two Macros constitute the only way to implement, respectively, user services and extraction methods in Business Components. They are used to migrate the Pacbase applications. In this case, they are automatically called with the correct parameters in the -CP Lines of the relevant Business Components. If you want to implement user services or extraction methods, you must call the appropriate Macro in the -CP Lines of a Business Component and specify its parameters. The user services and extraction methods that are implemented in another way are ignored. From Rational Programming Patterns V9.5.1, they constitute inactive code that you can remove. A warning is automatically displayed in the COBOL code. This case also applies to the user services and extraction methods that were called from the function and subfunction wizard in an earlier version of Rational Programming Patterns.
- A user service is entirely described with specific code. For example, it can count
the number of customers per day who issue an order. It is described with specific code. To call it in a
Business Component, call Macro ££USER and indicate the following parameters:
- $1 is the function code on 2 characters
- $2 is the subfunction code on 2 characters
- $3 is the level on 2 characters
- $4 is the user service title on 32 characters
- $A is the user service name on 27 characters (INCREMENT for example)
Note: If you want to reuse a user service, you can describe it in a Business Component and call this Business Component from other Business Components. - An extraction method is a particular selection that is requested upon a selection service of a
Business Component. To call it in a Business Component, call Macro
££80EX and indicate the following parameters:
- $1 is the function code on 2 characters.
- $2 is the Segment on 4 characters.
- $3 is the access type on 2 characters.
- If only one customized access type is described for the extraction method in the Segment -GG Lines, you must enter EX for the access type in the Macro call.
- If the four access types of the extraction method are customized in the Segment -GG Lines, you must specify each access type in a Macro call. You must then call the Macro four times for the extraction method. In the Macro calls, you must enter the customized access types that correspond to the standard access types: DC (DECLARE CURSOR), P (OPEN CURSOR), RN (FETCH), and CL (CLOSE CURSOR).
- $4 is the extraction method name on 10 characters. It must correspond to the name that is indicated in the Segment -GG Lines.
- $A is the title of the extraction method on 32 characters.
- Buttons that represent the Macro editor tabs. Click them to open the corresponding tabs.
- The line number.