Pathmaker Programming Guide
Modifying Requester/Server Pairs
Advanced Pathmaker Programming Topics
067868 Tandem Computers Incorporated 9–63
To add a select-and-return function to this sample application, you should modify
SQL-ORDERS-LIST to:
1. Add a return action (RETN) to function key F10.
2. Add the requester copy library. The SCREEN COBOL code for F10 in the
requester copy library for SQL-ORDERS-LIST should:
a. Find the current cursor position. Because you are not sending a request to a
service, you must use 0900-BUILD-CURSOR-POSITION to find the cursor
position.
(Note that in this example, the display fields for the list of values are not
protected on the application screen. If you want to protect the list display
fields, you can use point fields and a series of IF statements to find the cursor
position.)
b. Move the data item corresponding to that cursor position to a parameter
(ORDER-LIST-CONTEXT).
c. Set T9154-REASON-CODE to indicate that you are returning data.
d. Return to the previous requester, passing the parameter to the calling
requester.
The requester copy library for SQL-ORDER-TAKER could look like this:
?SECTION USER-COMPILER-CMDS , TANDEM
?SYMBOLS
?SECTION USER-WS , TANDEM
?SECTION USER-SECURITY , TANDEM
?SECTION USER-INIT-DATA , TANDEM
MOVE 0 TO T9154-REASON-CODE.
?SECTION USER-POST-F10 , TANDEM
IF T9154-REASON-CODE = 2
MOVE REFERENCE-DATE OF CURRENT-KEY OF ORDER-LIST-CONTEXT
TO ORDER-TIMESTAMP-DATE OF ORDERS
MOVE REFERENCE-TIME OF CURRENT-KEY OF ORDER-LIST-CONTEXT
TO ORDER-TIMESTAMP-TIME OF ORDERS.
You should modify SQL-ORDER-TAKER to:
1. Receive a parameter (ORDER-LIST-CONTEXT) from SQL-ORDERS-LIST.
(Note that to pass parameters between requesters, you use the Requester
Parameters screen of the called requester and the CALL Parameter Definition
screen of the calling requester.)
2. Add a requester copy library. The SCREEN COBOL code in the requester copy
library for SQL-ORDER-TAKER should:
a. Test to see if data was returned (this example uses T9154-REASON-CODE as a
flag).
b. If data was returned, move the data to the Working-Storage data area that the
screen field uses.