TRANSFER Programming Manual
Sample Client Code
Designing and Writing a Client
9–50 069138, Update 1 to 040970 Tandem Computers Incorporated
 839 CODE 3 YIELDS ipc-hdr,
 840 ON ERROR MOVE TERMINATION-STATUS TO term-status
 841 PERFORM error-section
 842 GO TO scan-mail-section-exit.
 843
 844 IF ih-pw-reply-code > 1
 845 PERFORM error-section
 846 MOVE "Y" TO exit-scan-flag
 847 GO TO scan-mail-section-exit.
 848
 849 IF rsp-scn-num-returned = 0
 850 MOVE "Y" TO exit-scan-flag
 851 GO TO scan-mail-section-exit.
 852
 853 RESET TEMP msg.
 854
 855 PERFORM get-mail-section
 856 VARYING scan-index FROM 1 BY 1
 857 UNTIL scan-index > rsp-scn-num-returned OR exit-scan.
 858
 859 scan-mail-section-exit.
 860 EXIT.
 861 /
 862 get-mail-section SECTION.
 863
 864 *********************************************************************
 865 * Builds the UOW to get the data and display one package from the *
 866 * list. *
 867 *********************************************************************
 868
 869 BEGIN-TRANSACTION.
 870
 871 MOVE "N" TO item-flag.
 872 MOVE rsp-scn-items-returned( scan-index )
 873 TO uow-gid-item-id,
 874 uow-gir-item-id OF get-subject-rec-uow,
 875 uow-gir-item-id OF get-recip-text-uow,
 876 uow-gir-item-id OF get-text-rec-uow,
 877 uow-ack-item-id.
 878
 879 MOVE "GET ITEMS" TO error-name.
 880 MOVE -3 TO ih-request-code.
 881 MOVE 5 TO ih-uows-to-process.
 882
 883 *********************************************************************
 884 * SENDS THE IPC TO GET THE DATA AND DISPLAY THE PACKAGE. Because *
 885 * this request includes the ACK-RECEIPT UOW along with the other *
 886 * data-retrieval UOWs, a TMF transaction is required. *
 887 *********************************************************************
 888
 889 SEND ipc-hdr,
 890 get-item-descr-uow,
 891 get-subject-rec-uow,
 892 get-recip-text-uow,
 893 get-text-rec-uow,
 894 ack-receipt-uow
 895 TO "TISERV"
 896 REPLY CODE 0, 1, 2 YIELDS ipc-hdr,
 897 get-item-descr-rsp,
 898 get-subject-rec-rsp,
 899 get-recip-text-rsp,
 900 get-text-rec-rsp,
 901 ack-receipt-rsp
 902 CODE 3 YIELDS ipc-hdr
 903 ON ERROR MOVE TERMINATION-STATUS TO term-status
 904 PERFORM error-section
 905 ABORT-TRANSACTION
 906 GO TO accept-mail-data.
 907










