|
<pnelson@xxxxxxxxxx> wrote in message news:OFA8364F1F.57DDD235-ON86257090.0046F2A5-86257090.00470673@xxxxxxxxxxxxx > Anybody got one they'd care to share with me? Thanks > -- > Paul - VERY rudimentary example . . . PGM PARM(&MSGQ &MSGQLIB &MSGKEY) /*********************************************************************/ /* */ /* Read messages from msgq UTILITY/UPSMSGQ (updated by sysval */ /* QUPSMSGQ. Monitor for various UPS messages and send messages. */ /* */ /*********************************************************************/ DCL VAR(&MSGQ) TYPE(*CHAR) LEN(10) DCL VAR(&MSGQLIB) TYPE(*CHAR) LEN(10) DCL VAR(&MSGKEY) TYPE(*CHAR) LEN(4) DCL VAR(&MSGF) TYPE(*CHAR) LEN(10) DCL VAR(&MSGFLIB) TYPE(*CHAR) LEN(10) DCL VAR(&MSGID) TYPE(*CHAR) LEN(7) DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(100) DCL VAR(&MSG) TYPE(*CHAR) LEN(132) GETMSG: RCVMSG MSGQ(&MSGQLIB/&MSGQ) MSGTYPE(*FIRST) WAIT(0) + RMV(*NO) MSG(&MSG) MSGDTA(&MSGDTA) + MSGID(&MSGID) MSGF(&MSGF) MSGFLIB(&MSGFLIB) SNDRPY MSGKEY(&MSGKEY) MSGQ(&MSGQLIB/&MSGQ) + RPY('G') RMV(*YES) /* */ /* CPF1816 indicates that we are on battery power */ /* CPF1817 indicates that we are no longer on battery power */ /* CPI0961 indicates that the UPS has been disconnected */ /* CPI0962 indicates that the UPS has been connected to the system */ /* CPI0963 indicates that the system is on auxiliary power */ /* CPI0964 indicates that the UPS has a weak battery */ /* CPI0973 indicates that the UPS no longer has a weak battery */ /* CPI0974 indicates that the UPS has been bypassed */ /* CPI0975 indicates that the UPS is no longer bypassed */ /* CPI097A indicates the date and time that system power restored */ /* CPI0994 indicates system power restored */ /* CPF181A indicates the date and time that system power failed */ /* CPP3500 indicates UPS reported a utility failure */ /* CPP3501 indicates UPS reported power restored */ /* */ IF COND(&MSGID *EQ 'CPF1816' *OR + &MSGID *EQ 'CPF1817' *OR + &MSGID *EQ 'CPI0961' *OR + &MSGID *EQ 'CPI0962' *OR + &MSGID *EQ 'CPI0963' *OR + &MSGID *EQ 'CPI0964' *OR + &MSGID *EQ 'CPI0973' *OR + &MSGID *EQ 'CPI0974' *OR + &MSGID *EQ 'CPI0975' *OR + &MSGID *EQ 'CPI097A' *OR + &MSGID *EQ 'CPI0994' *OR + &MSGID *EQ 'CPF181A' *OR + &MSGID *EQ 'CPP3500' *OR + &MSGID *EQ 'CPP3501') + THEN(DO) SNDUSRMSG MSG('HR400AL1 ' *cat &MSG *tcat ' ') + MSGTYPE(*INFO) TOUSR(STEVE) ENDDO /* */ EOJ: ENDPGM
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.