When you call a Macro, its lines are inserted in a batch
or online program. You can then use standard sequences of specific
code several times in the same program or in different program. To
call a Macro, you must select it in the -CP Lines tab.
If it is parameterized, you must assign values to its parameters.
Procedure
- Open the-CP Lines tab of a Program
or a Screen.
- Click Add Macro or select this action
in the contextual menu. A selection box opens up with the list of
the available Macros.
- If the Macro you want to call is displayed in this selection
box, select it and click OK.
- If the Macro you want to call is not displayed, click New
Macro in the selection box. In the creation wizard which
opens up, enter the name and label of
a new Macro and click OK. The new Macro is
then displayed in the selection box. If you select it and click OK,
it is called in the -CP Lines.
- If the Macro is parameterized, you must assign values to
its parameters. To assign a value, perform the following actions:
- Select a Macro call. The Macro
call section opens up.
- Enter the line number of the Macro call.
- Initially, only the first 10 parameters ($n,
with n= 1,2,...,9,0)
are displayed. So if you want to add 10 parameters more ($x,
with x= A,,...J)
you must click Add.
- In the Parameters table of the Macro
call section, select the line of the appropriate parameter.
If its value is:
- A simple character string, enter this value in the Value column.
The number of characters used for each parameter value must correspond
to the appropriate field length for the element being parameterized.
For example, if $1 is being used as a function
code, the value must be two characters long.
- A Data Element, Data Structure or Segment, check the box in the Entity
call and click inside the Linked instance column.
A selection window, with the available Data Elements, Data Structures,
and Segments, opens up. Select one of the instances and click OK.
The Linked
instance column then displays E=DELCO, D=DD or S=SEGT (where DELCO, DD and SEGT represent
the instance code). At the time of transformation, the parameter is
replaced by DELCO, DD or SEGT and
cross-references are set up.
- Each occurrence of the parameter in the Macro is then replaced
by the value entered for this particular Program.
- Repeat the operation for all the parameters used in
the Macro.