Pathmaker Programming Guide
Modifying Requester/Server Pairs
Advanced Pathmaker Programming Topics
067868 Tandem Computers Incorporated 9–61
“Creating a NonStop SQL Pathmaker Application” in Section 10 is another example of
creating a screen that displays lists. This example includes step-by-step instructions
that explain how to create the screen and its corresponding services. In the Section 10
example, you create a values list screen to display the values stored in a NonStop SQL
table, ORDERS. The Orders List screen displays a subset of the columns in the
ORDERS table.
The Enscribe DDL for the Orders List screen in Section 10 looks like this:
DEF REFERENCE-NUMBER.
02 REFERENCE-DATE PIC 9(6).
02 REFERENCE-TIME PIC 9(8).
END.
DEF ORDER-LIST-CONTEXT.
02 CURRENT-KEY TYPE REFERENCE-NUMBER.
02 ORDERS-LIST-ARRAY.
03 LIST-INDEX PIC 9(2).
03 ORDERS-LIST OCCURS 10 TIMES.
04 REFERENCE-NUMBER TYPE *.
04 LAST-NAME PIC X(20).
04 AREA-CODE PIC 9(3).
04 DISTRICT-CODE PIC 9(3).
04 LAST-4-DIGITS PIC 9(4).
END.
Services for List Screens
The logic in the LIST service:
Initializes the array.
Fetches rows, one by one, and places them into a host variable until either no more
rows can be found or all ten rows have been retrieved.
Moves the primary key of the last found row to the CURRENT-KEY.
The logic in the LIST NEXT service:
Initializes the array.
Fetches the next set of rows from the table, beginning with the row that follows the
CURRENT-KEY, until either no more rows can be found or all ten rows have been
retrieved.
Moves the primary key of the last found row to the CURRENT-KEY.
The Custom Source File named SERVCOD3, which is used in the third sample
application in Section 10, contains the SQL-COBOL code for these services.
When creating a service for a screen that displays lists, always set T9154-REPLY-FLAG
to T9154-RETURN-SERVICE-REPLY after collecting a list of values from a database
file. The Pathmaker product interprets a record-not-found condition as an error and
sets T9154-REPLY-FLAG to T9154-ADVISORY-ONLY.