1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 execom_:
22 proc (p_mcb_ptr, p_com_len, p_command, p_cmd_id, p_system,
23 p_major_cap, p_ecode);
24
25
26
27
28
29
30
31
32
33
34
35 dcl p_mcb_ptr ptr parameter;
36 dcl p_com_len fixed bin parameter;
37 dcl p_command char (*) parameter;
38 dcl p_cmd_id fixed bin parameter;
39 dcl p_system fixed bin parameter;
40 dcl p_major_cap fixed bin parameter;
41
42
43
44 dcl p_ecode fixed bin (35);
45
46
47
48 dcl return_status fixed bin;
49 dcl dest_maj fixed bin;
50
51
52
53 dcl 01 data,
54 02 cmd_id fixed bin (17) unal,
55 02 status char unal;
56
57
58
59 dcl send_msg_ entry (ptr, fixed bin, fixed bin, ptr,
60 fixed bin, fixed bin, fixed bin (35));
61 dcl capability_$pack entry (fixed bin, fixed bin, fixed bin,
62 fixed bin (35));
63 dcl cu_$cp entry (ptr, fixed bin (21), fixed bin (35));
64
65
66 dcl fatal_mowse_trap_ entry (fixed bin (35));
67
68
69
70
71 dcl addr builtin;
72 dcl byte builtin;
73 dcl length builtin;
74
75
76 dcl cleanup condition;
77
78
79
80
81 p_ecode = 0;
82
83 on cleanup
84 begin;
85 data.cmd_id = p_cmd_id;
86 data.status = byte (STATUS_FAILED);
87 call send_msg_ (p_mcb_ptr, dest_maj, EXECUTE_COMMAND_REPLY,
88 addr (data), 3, BG, p_ecode);
89 if p_ecode ^= 0 then do;
90 call fatal_mowse_trap_ (p_ecode);
91 goto ERROR_RETURN;
92 end;
93 end;
94
95
96
97
98
99 call capability_$pack (p_system, p_major_cap, dest_maj, p_ecode);
100 if p_ecode ^= 0 then do;
101 call fatal_mowse_trap_ (p_ecode);
102 return;
103 end;
104
105
106
107 call cu_$cp (addr (p_command), length (p_command), p_ecode);
108
109
110
111
112
113 if p_ecode ^= 0 then
114 return_status = STATUS_FAILED;
115 else
116 return_status = STATUS_SUCCESS;
117
118 data.cmd_id = p_cmd_id;
119 data.status = byte (return_status);
120
121 call send_msg_ (p_mcb_ptr, dest_maj, EXECUTE_COMMAND_REPLY,
122 addr (data), 3, BG, p_ecode);
123 if (p_ecode ^= 0) then do;
124 call fatal_mowse_trap_ (p_ecode);
125 return;
126 end;
127
128 return;
129
130 ERROR_RETURN:
131 return;
132
133 %page;
134
135 %include mowse;
136 %include mowse_messages;
137
138
139 end;