Example: Creating a mapped method to call external COBOL code
A typical usage of a COBOL macro method is to include an external paragraph file in the generated COBOL code.
About this task
You can use COBOL mapped method to include an external paragraph file in the generated COBOL code and do actions in your rules that are defined in an external COBOL file. If you want to do actions in your rules that are defined in an external COBOL file, you can include the file in the PROCEDURE SECTION of the generated COBOL code. You include an external paragraph file by using a macro method.
Procedure
To include an external paragraph file:
Results
In the following example, the PROCEDURE DIVISION of the generated COBOL code includes an external file named EXTERNAL-PARA:
PROCEDURE DIVISION.
* Rule testExternalParagraph
RULE-1TESTEXTERNALPARAGRAPH.
PERFORM PARAGRAPH-1.
PERFORM PARAGRAPH-2.
.
.
.
COPY EXTERNAL-PARA
.
.
.