Pathmaker Programming Guide

Coding Custom Services
Creating Services and Servers
4–46 067868 Tandem Computers Incorporated
Invoking Macros From a
Custom Source File
The Pathmaker product supports the creation and use of shared code macros by
providing the Pathmaker macro language (and its macro expansion facility) and the
ability to register macros within a Pathmaker project.
Macros exist as EDIT files containing source code. Creating and registering Pathmaker
macros is described under “Preparing Shared Code for a Pathmaker Project” in
Section 2 of this manual.
The simplest example of a macro is one that contains source code written only in a
programming language such as COBOL85. These files are equivalent to COPY library
files and are invoked in the code you write; these files do not use the Pathmaker macro
language or the expansion facility.
Complex macros that use the Pathmaker macro language and the expansion facility
are created using the Pathmaker macro language. These macros can:
Accept substitution parameters
Emit blocks of text
Modify text
Conditionally use text and commands
Iterate lines of text and commands
Invoke another macro, passing substitution parameters
Using a Registered Macro
Whether a macro is just a COPY library or is a complex macro, it can be registered on
the Macro Registration screen. Each registered macro has a Pathmaker name. You can
invoke a registered macro in the code you write using only its Pathmaker name. If the
location of the physical file containing the macro changes, the code invoking the macro
does not have to be changed.
Code for each registered macro must begin with a section having the same name as the
Pathmaker macro name, as shown below:
?SECTION
Pathmaker-macro-name
To use a macro that has been registered, use the following statement in your code:
INVOKE "
macro-name
"
Macros that are invoked in your code are expanded during generation and included in
the source code.
Using a Macro That Has Not Been Registered
To use a macro that has not been registered, use the following statement in your code:
INVOKE "
macro-name
" IN
file-name
Macros that are invoked in your code are expanded during generation and included in
the source code.