Pathmaker Programming Guide
Coding Custom Services
Creating Services and Servers
067868 Tandem Computers Incorporated 4–47
Example of Invoking a Registered Macro
Figure 4-10 shows an example of how you can use a registered macro in a COBOL
custom source file. The macro being invoked appears in Section 2, Figure 2-2. The
macro is used to check for the existence of data in either the DEPT table or the
EMPNUM table, depending upon the value of the parameters passed to the macro.
Figure 4-10. Example of Invoking a Registered Macro
*************************************************************
* P A T H M A K E R C U S T O M S O U R C E F I L E
...
?SECTION T9XS-SVC001
*
?SECTION T9WS-SVC001
*
* Begin user Working-Storage
%INVOKE "check-existence-ws" <−− Name of Pathmaker macro
containing working-storage items.
*
...
?SECTION T9PR-SVC001
* Begin user Procedure Division
*
MOVE ZEROS TO EMPNUM OF T9154-REPLY.
...
8000-DO-EMPLOYEE-CHECK.
% INVOKE <−− Name of Pathmaker macro containing procedure code.
"check-existence-proc" ("EmpDtl", "empnum of empdtl-host")
8000-DO-DEPT-CHECK.
% INVOKE <−− Name of Pathmaker macro containing procedure code.
"check-existence-proc" ("Dept", "deptnum of dept-host")
...