Exchange/SNA Manual
Console Program Example
Example Programs
E–16 104700 Tandem Computers Incorporated
Page 5 [1] $RJE.EXCHAPPL.CONSRC 1991-05-29 13:38:20
EXCHANGE/SNA CONSOLE APPLICATION EXAMPLE
249. 000000 0 0 !****************************************************************************!
250. 000000 0 0 ! PROCEDURE INITIALIZE !
251. 000000 0 0 ! This procedure opens $RECEIVE, reads the start up message, and closes !
252. 000000 0 0 ! $RECEIVE. Then the home terminal is opened and the console is opened. !
253. 000000 0 0 !****************************************************************************!
254. 000000 0 0
255. 000000 0 0 PROC initialize;
256. 000000 1 0
257. 000000 1 0 BEGIN
258. 000000 1 1 CALL OPEN (recv^name, recv^fnum);
260. 000010 1 1 IF <> THEN CALL DEBUG;
261. 000012 1 1 CALL READ (recv^fnum, startmsg, $LEN(startmsg));
264. 000022 1 1 IF <> THEN CALL DEBUG;
265. 000024 1 1 CALL CLOSE (recv^fnum);
266. 000031 1 1
267. 000031 1 1 CALL MYTERM (term^name);
268. 000034 1 1 CALL OPEN (term^name, term^fnum, nowait^1^out);
271. 000045 1 1 IF <> THEN CALL DEBUG;
272. 000047 1 1 length := FNAMEEXPAND (startmsg.params, server^file^name, startmsg.default);
275. 000062 1 1 IF length = 0
276. 000062 1 1 THEN ! Invalid name
277. 000064 1 1 BEGIN
278. 000064 1 2 sbuf^term ':=' ["INVALID EXCHANGE/SNA LINE SERVER NAME"] -> @sp^term;
279. 000075 1 2 term^out^cnt := @sp^term '-' @sbuf^term;
280. 000101 1 2 CALL display^error (ibuf^term, term^out^cnt);
282. 000105 1 2 END;
283. 000105 1 1 CALL OPEN (server^file^name, cons^fnum, nowait^1^out);
286. 000116 1 1 IF <>
287. 000116 1 1 THEN
288. 000117 1 1 BEGIN
289. 000117 1 2 CALL FILEINFO (cons^fnum, error);
291. 000130 1 2 sbuf^term ':=' ["CAN'T OPEN EXCHANGE/SNA LINE SERVER -- ERROR: "
292. 000130 1 2 ]-> @sp^term;
293. 000141 1 2 term^out^cnt := @sp^term '-' @sbuf^term;
294. 000145 1 2 CALL NUMOUT (sbuf^term[term^out^cnt-3], error, 10, 3);
298. 000155 1 2 CALL display^error (ibuf^term, term^out^cnt);
300. 000161 1 2 END;
301. 000161 1 1 END;