TRANSFER Programming Manual
Sample Client Code
Designing and Writing a Client
069138, Update 1 to 040970 Tandem Computers Incorporated 9–53
1046 IF NOT post-request
1047 MOVE "FUNCTION KEY PRESSED IS NOT ALLOWED" TO ws-error
1048 DISPLAY TEMP error-line OF base-screen
1049 GO TO accept-mail-posting.
1050
1051 PERFORM post-mail-section.
1052
1053 compose-mail-section-exit.
1054 EXIT.
1055 /
1056 post-mail-section SECTION.
1057
1058 *********************************************************************
1059 * The request for actual mail posting, with many operations *
1060 * requested within the framework of a TMF transaction. *
1061 *********************************************************************
1062
1063 BEGIN-TRANSACTION.
1064
1065 DISPLAY TEMP "POSTING" IN msg.
1066
1067 * Describe the package to create:
1068 MOVE 109 TO uow-cri-item-type.
1069 MOVE "Y" TO uow-cri-is-pkg-hdr.
1070
1071 MOVE "CREATE" TO error-name.
1072 MOVE -3 TO ih-request-code.
1073 MOVE 1 TO ih-uows-to-process.
1074
1075 SEND IPC-HDR, create-item-uow
1076 TO "TISERV"
1077 REPLY CODE 0, 1, 2 YIELDS ipc-hdr, create-item-rsp
1078 CODE 3 YIELDS ipc-hdr
1079 ON ERROR MOVE TERMINATION-STATUS TO term-status
1080 PERFORM error-section
1081 ABORT-TRANSACTION
1082 GO TO post-mail-section-exit.
1083
1084 IF ih-pw-reply-code > 1
1085 PERFORM error-section
1086 ABORT-TRANSACTION
1087 GO TO post-mail-section-exit.
1088
1089 * Set up the data in each UOW to be sent:
1090 MOVE rsp-cri-item-id TO uow-ar-item-id.
1091 MOVE 340 TO uow-ar-recip-type.
1092 MOVE ALL "N" TO uow-ar-options.
1093 MOVE "Y" TO uow-ar-use-depot-resol-flags.
1094
1095 IF add-subject-count > 0
1096 MOVE "UW" TO asu-self-ident( 1 )
1097 MOVE 104 TO asu-uow-code( 1 )
1098 MOVE rsp-cri-item-id TO asu-item-id( 1 )
1099 MOVE 115 TO asu-rec-type( 1 )
1100 MOVE 1 TO asu-rec-seq-num( 1 )
1101 MOVE 40 TO asu-data-byte-count( 1 ).
1102
1103 PERFORM init-uow-air
1104 VARYING air-index FROM 1 BY 1
1105 UNTIL air-index > add-text-array-count.
1106
1107 MOVE "ADD ITEMS" TO error-name.
1108 MOVE -3 TO ih-request-code.
1109 COMPUTE
1110 ih-uows-to-process = (1 + add-text-array-count + add-subject-count).
1111
1112 *********************************************************************
1113 * SENDS THE IPC TO ADD RECIPIENT, SUBJECT, AND TEXT RECORDS TO *
1114 * PACKAGE. *