Some system maintenance can be done only when the machine has no users. Examples are changes to subsystem descriptions, deleting or moving files that are normally open, and applying PTFs to Licensed Program Products (LPP). If you IPL the system during off-hours, you normally have to change your startup program to do these things for you each time they need to be done, or do them manually.
If you add the following lines to your system startup program before it starts any subsystems, you can create programs on the fly to take care of these tasks:
CALL PGM(IPLPGMCL) MONMSG MSGID(CPF0000) DLTPGM PGM(IPLPGMCL) MONMSG MSGID(CPF0000)
An example of a program to call is shown in 5. Just add what needs to be done and compile the program. The next time the system is IPL'd, your program object will be called, your tasks will be done, and the program object will be deleted. Deleting the program will keep it from being called twice.
An example of a program to call is shown in Figure 5. Just add what needs to be done and compile the program. The next time the system is IPL'd, your program object will be called, your tasks will be done, and the program object will be deleted. Deleting the program will keep it from being called twice.
You should take some safety measures when using this technique. First, because the system will need user intervention to answer error messages if your program fails, you should include a global Monitor Message (MONMSG) command in IPLPGMCL. To see if everything was successful, force the creation of a job log. You can even have the program send the job log to your central AS/400 if you have more than one system.
If your startup program adopts authority, this technique will create a security exposure. To eliminate it, create a library that can only be accessed by the profile that owns the startup program. Place the onetime program in this library. You can then hardcode the CALL in the startup program, preventing anyone from creating a onetime program in another library in the library list that will inherit the caller's authority.
- Martin Pluth
TechTalk: A onetime startup program can save you work during an IPL.
Figure 5: Example Onetime Startup Program IPLPGMCL
PGM MONMSG MSGID(CPF0000) /* Insert onetime code here */ DSPJOBLOG OUTPUT(*PRINT) HLDSPLF FILE(QPJOBLOG) SPLNBR(*LAST) /* If you have more than one AS/400, send the joblog */ SNDNETSPLF FILE(QPJOBLOG) TOUSRID((PLUTH MCEDIT)) + SPLNBR(*LAST) DLTSPLF FILE(QPJOBLOG) SPLNBR(*LAST) ENDPGM
LATEST COMMENTS
MC Press Online