Creating macro methods
You use macro methods to implement simple COBOL bodies by using COBOL expressions or statements.
About this task
You use macro methods to implement simple COBOL bodies by using COBOL expressions or statements. You add macro methods to a BOM class.
You create a macro method by creating a method in Rule Designer and then implementing the COBOL code for the method. Then, when you generate the COBOL code for rule execution, the generated code can exchange data with the COBOL calling program.
Procedure
To create a macro method:
Results
The method is included in the generated COBOL code, and
the generated code can exchange data with the COBOL calling program.
In the above example, the generated COBOL code becomes: x >
y
A common usage for this type of method is the IS
ALPHABETIC check described in Example: Creating a macro method to check data types.
Take care when implementing a macro method, because
the implementation might in some cases generate incorrect COBOL code.
For example, MOVE 1+1 TO varItem is the same as MOVE
2 TO varItem. However, TableItem(2, 1) is
not equal to TableItem(1+1, 1) because 1+1 is
not a valid index in a table data item.
If you are not sure that the macro method code generates correct COBOL code, use a mapped method instead.
