- Because of the critical nature of a power-handling program, you
should isolate the objects used by the power-handling program in their own
library and secure them from other users, as follows:
CRTLIB LIB(UPSLIB) AUT(*EXCLUDE) CRTAUT(*EXCLUDE)
- A power-handling program requires exclusive use of a message queue.
For this reason, you should create a unique message queue and exclude its
use from all other users and general system use, as follows:
CRTMSGQ MSGQ(UPSLIB/UPSMSGQ) AUT(*EXCLUDE)
- Create the CL power-handling program and exclude its use from all
other users, as follows:
CRTCLPGM PGM(UPSLIB/UPSPGM) AUT(*EXCLUDE)
- Create the job description for the power-handling program you want
started automatically whenever the controlling subsystem is started.
CRTJOBD JOBD(UPSLIB/UPSJOBD) JOBQ(QSYS/QCTL2)
JOBPTY(1) RQSDTA('CALL UPSLIB/UPSPGM')
AUT(*EXCLUDE) USER(xxxxx)
Note: You
must provide a user profile to use the job description as an auto-start job.
- Create an alternative controlling subsystem description by making
a copy of the current controlling subsystem description, as follows:
CRTDUPOBJ OBJ(QCTL) FROMLIB(QSYS)
OBJTYPE(*SBSD) TOLIB(QSYS) NEWOBJ(QCTL2)
- Change your startup program to start all subsystems. You will
need to include a check to see if system value QCTLSBSD is equal to QCTL2.
See system value QSTRUPPGM for the name and library. If you do not change
the startup program it will not check for QCTL2 in QSYS or QGPL and the startup
program will end without starting the rest of your subsystems.
- Add the autostart job entry to the alternative controlling subsystem
description, as follows:
ADDAJE SBSD(QSYS/QCTL2) JOB(QSYS/QCTL2)
JOBD(UPSLIB/UPSJOBD)
- Change the controlling subsystem system value to use the alternative
controlling subsystem description, as follows:
CHGSYSVAL SYSVAL(QCTLSBSD) VALUE('QCTL2')
- Change the system values to allow the program to handle a power
outage, as follows:
CHGSYSVAL SYSVAL(QUPSMSGQ) VALUE('UPSMSGQ UPSLIB')
CHGSYSVAL SYSVAL(QUPSDLYTIM) VALUE(*NOMAX)
- Perform an IPL of the system to have the new controlling subsystem
description take effect, as follows:
PWRDWNSYS OPTION(*IMMED) RESTART(*YES)