Exchange/SNA Manual
Appendix E Example Programs
104700 Tandem Computers Incorporated E–1
This appendix presents two example programs. The programs assume that
Exchange/SNA is connected to an IBM host system that is running OS/MVS and JES2.
Send/Receive Program
Example
This program uses the programmatic interface to send and receive jobs to and from the
host. The example program requires a line server named $SNAX1, which you must
start before you run the program:
Page 1 [1] $RJE.EXCHAPPL.EXAPPL 1991-06-04 13:36:52
TAL - T9250C30 - (01DEC90)
Copyright Tandem Computers Incorporated 1976, 1978, 1981-83, 1985, 1987-90
2. 000000 0 0 ?NOCODE,NOMAP,NOLMAP,INSPECT,SYMBOLS
3. 000000 0 0 !****************************************************************************!
4. 000000 0 0 ! !
5. 000000 0 0 ! EXCHANGE/SNA PROGRAMMATIC EXAMPLE DATE 05/31/91 !
6. 000000 0 0 ! !
7. 000000 0 0 ! This example program sends a "do nothing" job to an IBM host system and !
8. 000000 0 0 ! receives the job output from the host. !
9. 000000 0 0 ! !
10. 000000 0 0 ! To run the program, enter !
11. 000000 0 0 ! !
12. 000000 0 0 ! RUN <objname> / OUT <out-file-name> / <line-server-name> !
13. 000000 0 0 ! !
14. 000000 0 0 ! <objname> is the name of object file produced from this source code. !
15. 000000 0 0 ! !
16. 000000 0 0 ! <out-file-name> is the name of spooler location or printer where !
17. 000000 0 0 ! the job output from the host is to be written. !
18. 000000 0 0 ! !
19. 000000 0 0 ! <line-server-name> is the name of an existing Exchange/SNA line !
20. 000000 0 0 ! server that supports at least one card reader subdevice named RD1 !
21. 000000 0 0 ! and one printer subdevice named PR1. !
22. 000000 0 0 ! !
23. 000000 0 0 !****************************************************************************!
24. 000000 0 0 ! Global declarations !
25. 000000 0 0
26. 000000 0 0 INT .term^name[0:11] := [12*[" "]],
27. 000014 0 0 term^fnum := -1,
28. 000014 0 0 .recv^name[0:11] := ["$RECEIVE", 8*[" "]],
29. 000030 0 0 recv^fnum := -1;
30. 000030 0 0
31. 000030 0 0 LITERAL buffer^length = 134;
32. 000030 0 0
33. 000030 0 0 INT .ibuffer[0:buffer^length/2-1];
34. 000133 0 0 STRING .sbuffer := @ibuffer '<<' 1,
35. 000133 0 0 .sp;
36. 000133 0 0
37. 000133 0 0 INT .server^file^name[0:11], ! Exchange/SNA line server !
38. 000147 0 0 server^fnum := -1,
39. 000147 0 0 .server^buffer[0:buffer^length/2-1];
40. 000252 0 0
41. 000252 0 0 INT out^fnum := -1;
42. 000252 0 0
43. 000252 0 0 INT write^count,
44. 000252 0 0 read^count := buffer^length,
45. 000252 0 0 count^read,
46. 000252 0 0 space,
47. 000252 0 0 records := 0,
48. 000252 0 0 error := 0;
49. 000252 0 0
50. 000252 0 0 LITERAL on = -1,
51. 000252 0 0 off = 0,
52. 000252 0 0 read^only^waited^io = %2000,
53. 000252 0 0 write^only^waited^io = %4000;