TRANSFER Programming Manual

Debugging Techniques
Designing and Writing a Client
9–18 069138, Update 1 to 040970 Tandem Computers Incorporated
7. When you are ready to read the records returned by the UOW, issue a read
request:
READ xfer-file WITH PROMPT xfer-rec (1: ptr - 1) END
SET eof TO TRUE
NOT AT END
Then, break the record down by following the steps shown in the PERFORM
construct in the listing. Specifically, you must:
Determine the number of records read:
MOVE xfer-rec (ptr: fixed-part-size) TO
get-item-rec-rsp
Compute the size of the response from TISERV:
COMPUTE temp-nbr - fixed-part-size +
(variable-part-size * num-returned)
Get the actual response:
MOVE xfer-rec (ptr: temp-nbr) TO get-item-rec-rsp
Process the data in the response by invoking a nested program that handles
this task:
ADD temp-nbr TO ptr
CALL process-reply
Note that when you determine the number of records read and get the actual response,
you can use the COBOL85 technique of reference modification. With this technique,
you can define an elementary item by specifying a leftmost character position (PTR in
this example) within a data item (XFER-REC) and a length (FIXED-PART-SIZE or
TEMP-NBR) for the new item.
To manipulate the data returned using COBOL 74, you proceed in a similar way. With
COBOL 74, however, you use the POINTER phrase of the STRING or UNSTRING
statement to manipulate the data returned.
Debugging Techniques As an option, the TRANSFER delivery system will record information that passes
between your client and TISERV and store the information in the debug log file. To
enable this logging, you issue an ASSIGN directive and two PARAM directives to the
server, as illustrated by this example:
ALTER SERVER serverclass, (ASSIGN DEBUGLOG, &
$vol.subvol.file), (PARAM DEBUGLOGLEVEL 0), &
(PARAM DEBUGLOGFORMAT TRUE)