Pathmaker Reference Manual
Appendix B Macro Language Example
067869 Tandem Computers Incorporated B–1
This appendix contains an example of a macro coded in the Pathmaker macro
language. The appendix also includes the source code that is generated when the
macro is invoked. For the complete syntax of the macro language, refer to Section 3.
Sample Macro The following macro generates I/O operations code that a service can use in accessing
the service’s files. The macro is invoked by an INVOKE command in the custom
source file. The source code generated by this macro when it is invoked appears in the
following subsection of this appendix.
?section EnscribeIOParagraphs
% SET paragraph-num 8000
% ITERATE #service-files THRU LINES UNTIL TAG label-100
% IF #file-system = "Enscribe" USE LINES UNTIL TAG label-200
% IF #access-method = "Key-seq" USE LINES UNTIL TAG label-300
% ITERATE #items THRU LINES UNTIL TAG label-400
% IF #item-key-type = "primary" USE 1 LINES
% SET keyname "$#item-name$"
% SET file-record-name "$#file-record-name$"
% END-ITERATE label-400
% SET paragraph-num paragraph-num + 10
$paragraph-num$-read-exact-operation.
Read $#file-logical-name$ key is $keyname$ OF $file-record-
name$;
Invalid key perform $paragraph-num$-error-proc.
$paragraph-num$-read-next-start.
Start $#file-logical-name$ key is greater than $keyname$ OF
$file-record-name$;
Invalid key perform $paragraph-num$-bad-start.
$paragraph-num$-read-next-operation.
Read $#file-logical-name$ next record;
At end perform $paragraph-num$-no-more-records.
$paragraph-num$-read-approx-start.
Start $#file-logical-name$ key not less than $keyname$ OF
$file-record-name$;
Invalid key perform $paragraph-num$-bad-start.
$paragraph-num$-error-proc.
Move "You must supply a value valid for $keyname$" to
T9154-advisory-msg-text
Move "E" to T9154-advisory-msg-severity.
$paragraph-num$-bad-start.