In the past I’ve written programs to monitor for power loss. You need to setup the system value QUPSMSGQ to another message queue. You write a small CL program to monitor the message queue using the RCVMSG command. When a message is received on this queue, then you take appropriate action, for example PWRDWNSYS.
I believe the message queue will only receive messages if your UPS is connected to the UPS connector on your iSeries.
Hope this helps,