TRANSFER Programming Manual

Sample Agent Program Code
Designing and Writing an Agent
10–22 069138, Update 1 to 040970 Tandem Computers Incorporated
3< 3210 20 AG-LNK-RESERVED-5 PIC A
3< 3211 .
3< 3212 20 AG-LNK-RESERVED-6 PIC A
3< 3213 .
3< 3214 20 AG-LNK-RESERVED-7 PIC A
3< 3215 .
3< 3216 15 AG-LNK-SUBJECT-STRING PIC X(140).
3< 3217 10 AG-LNK-DEPOT-INFO.
3< 3218 15 AG-LNK-AGENT-DATA PIC X(80).
108
109 01 ls-rep-agent-link-reply.
110 * COPY ag-rep-agent-link-reply OF "glnk".
3< 3220 * Definition AGENT-LINK-REPLY created on 12/01/86 at 14:52
3< 3221 05 AG-REP-AGENT-LINK-REPLY.
3< 3222 10 AG-REP-ERROR-INFO.
3< 3223 15 AG-REP-ERROR-RETURN PIC S9999 COMP.
3< 3224 88 AG-REP-GO-TO-NEXT-AGENT Value is 0.
3< 3225 88 AG-REP-DONT-GO-TO-NEXT-AGENT Value is 1.
3< 3226 88 AG-REP-AGENT-ERROR Value is 2.
3< 3227 88 AG-REP-AGENT-RESTART Value is 3.
3< 3228 88 AG-REP-GO-TO-NEXT-W-SESS Value is 100.
3< 3229 88 AG-REP-DONT-GO-TO-NEXT-W-SESS Value is 101.
3< 3230 88 AG-REP-AGENT-ERROR-W-SESS Value is 102.
3< 3231 15 AG-REP-ERROR-MSG PIC X(80).
111 /
112 PROCEDURE DIVISION USING ls-lnk-agent-link, ls-rep-agent-link-reply.
113
114 **********************************************************************
115 * MAIN ROUTINE *
116 **********************************************************************
117
118 A-MAIN.
119
120 **********************************************************************
121 * *
122 * NOTE - This agent assumes that: *
123 * (1) The name of the TISERV Server Class is "TISERV" *
124 * (2) The name of the INBOX Folder is "INBOX" *
125 * *
126 * Use the UOW "GET-CONFIG-NAME" to avoid making these *
127 * assumptions. *
128 * *
129 **********************************************************************
130
131 **********************************************************************
132 * (1) SET UP THE IPC HEADER *
133 **********************************************************************
134
135 MOVE "A01" TO ih-version-code.
136 MOVE ag-lnk-session-id TO ih-session-id.
137 MOVE "N" TO ih-log-this-ipc.
138 MOVE 0 TO ih-uows-returned.
139
140 **********************************************************************
141 * (2) PERFORM SERVICES *
142 **********************************************************************
143
144 IF ag-lnk-agent-data NOT = SPACES PERFORM 100-forward.
145 PERFORM 200-ack-and-unsave.
146
147 **********************************************************************
148 * (3) EXIT *
149 **********************************************************************
150
151 PERFORM 800-set-return-code.
152 PERFORM 900-exit.
153
154
155 100-forward.