 |
» |
|
 |
|
 |

Copyright (c) Digital Equipment Corporation 1991. All rights reserved
LAYERED PRODUCT: VAX PLI, V3.4 OP/SYS: VMS, V5.4-2
SOURCE: Digital Customer Support Center
OVERVIEW:
This program sends an operator a request to the terminal(s) enabled as
OPER12. It then prints the reply from the operator.
*** CAUTION ***
This sample program has been tested using VAX PL/I V3.4 on VMS V5.4-2.
However, we cannot guarantee its effectiveness because of the possibility
of error in transmitting or implementing it. It is meant to be used as a
template for writing your own program and it may require modification for
use on your system.
PROGRAM NOTES:
OPER privilege is required to reply to this program. The target
terminal needs to be enabled as OPER12. To do that, type the following
DCL command on the target terminal:
$ REPLY/ENABLE=OPER12
When the request has appeared, reply using the following DCL command:
$ REPLY/TO=nn "THIS IS THE REPLY THAT IS BEING SENT BACK TO THE PROGRAM"
$! nn is the request number that is displayed on the OPER12 terminal.
PROGRAM:
opr: proc options (main);
%include $iodef;
%include $stsdef;
%include $ssdef;
%include $opcdef;
%include sys$sndopr;
%include sys$qio;
%include sys$crembx;
dcl 1 cru union,
2 cr fixed bin(7) init(13),
2 crr char(1);
dcl 01 iosb,
05 iosb_status fixed bin(15),
05 iosb2 fixed bin(15),
05 iosb3 fixed bin(31);
dcl message_buffer char(132);
dcl mbx_channel fixed bin(15);
dcl 01 rbuffdef union,
2 rb,
05 targettype union,
10 rttype fixed bin(31),
10 rttypedef,
15 rq_type fixed bin(7) init(opc$_rq_rqst),
15 rq_target bit(24) init('000000000000000000000000'b),
05 rq_id fixed bin(31) init(999),
05 rq_text char(80),
2 request_buffer char(88);
dcl ctr fixed bin(15);
dcl stop_loop bit(1) init('0'b);
rq_target = opc$m_nm_oper12;
rq_text = 'This is a test of a SNDOPR request... please reply';
/* Create mailbox for operator reply to go to */
sts$value = sys$crembx(,mbx_channel,,,,,'OPERATOR_MBX');
if ^sts$success
then signal vaxcondition(sts$value);
/* Send message to operator and request a reply*/
sts$value =sys$sndopr(desc(request_buffer),value(mbx_channel));
if ^sts$success
then signal vaxcondition(sts$value);
/* Read the operator's reply */
sts$value = sys$qiow (,value(mbx_channel),value(io$_readvblk),ref(iosb),,,
ref(message_buffer),value(132),,,,);
if ^sts$success
then signal vaxcondition(sts$value);
if iosb_status ^= ss$_normal
then signal vaxcondition(iosb_status);
/* Parse out the 9-byte header */
ctr = 9;
do while (^stop_loop);
if (substr(message_buffer,ctr,1) = crr) | (ctr > 132)
then stop_loop = '1'b;
ctr = ctr + 1;
end;
/* Display the message */
put edit(' Message from operator: ',substr(message_buffer,9,ctr-10)) (a,a);
end opr;
|
buy online or call 1.800.AT.COMPAQ
|
|