Pathmaker Programming Guide
Preparing Shared Code for a Pathmaker Project
Preparing for Pathmaker Application Development
067868 Tandem Computers Incorporated 2–43
Figure 2-2 shows an example of a macro that 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.Refer to “Invoking Macros from a Custom Source
File” in Section 4 of this manual for an example of how this macro could be used in
service code.
Figure 2-2. Macro Example
?section check-existence-ws
* Variables for CHECK-EXISTENCE-PROC
01 key-flag PIC X.
88 key-found VALUE "1".
88 key-not-found VALUE "2".
EXEC SQL BEGIN DECLARE SECTION END-EXEC
01 result PIC 9(4).
EXEC SQL END DECLARE SECTION END-EXEC
?section check-existence-proc
% param TableName
% param KeyValue
MOVE 0 TO result.
% if TableName = "Dept" USE 1 LINES
% set keyname "Deptnum"
% if TableName = "EmpDt1" USE 1 LINES
% set keyname "Empnum"
EXEC SQL
SELECT $keyname$ INTO :result
FROM =$tablename$
WHERE $keyname$ = :$keyvalue$
END-EXEC.
IF result > ZERO THEN
MOVE "1" TO key-flag
ELSE
MOVE "2" TO key-flag.
User Conversion Routines The Pathmaker product allows the use of User Conversion routines, which are
Tandem Application Language (TAL) procedures for processing data passed between
a requester and a terminal screen. Refer to Section 9, “Advanced Pathmaker
Programming Topics,” for planning and implementation details.