Coming into a new AS/400 shop as System Administrator, the first thing I had to do was change the system startup program. The startup program is like the AUTOEXEC.BAT file on a DOS-based PC-the first job that runs when the system is powered up. On the AS/400, it starts all the important subsystems such as QINTER, QBATCH and QSPL, and it also starts up some jobs that need to be run at IPL time such as the automatic cleanup. Like us, you may need to modify the startup program to add programs or start subsystems at IPL. Here's how we did it.
In our case, we had to alter the program to start the RBTSLEEPER subsystem that runs Help Systems' Robot program. Since our startup program is the IBM- supplied program, QSTRUP, and they don't supply the source code for it, we had to retrieve the source code, alter it to start RBTSLEEPER, recompile the program to a different library and indicate to the AS/400 that it should now run the modified code instead of the IBM-supplied program.
In order to retrieve the name of your startup program, run the Display System Value (DSPSYSVAL) command, specifying system value QSTRUPPGM. The system presents a panel which shows the name of the startup program.
If your startup program is QSTRUP in library QSYS, retrieve the source code for it with the Retrieve CL Source (RTVCLSRC) command, as follows:
RTVCLSRC PGM(QSYS/QSTRUP) + SRCFILE(QGPL/QCLSRC) + SRCMBR(*PGM)
This command places the source code in source file QGPL/QCLSRC, member QSTRUP. PDM then allows you to change the code. (You may, of course, use a different source file and library.) We compiled ours to QGPL (instead of QSYS) because we preferred to keep the original version of the program intact. That meant that we needed to change system value QSTRUPPGM to point to the new, updated program in QGPL rather than the original, IBM-supplied program in QSYS.
To change QSTRUPPGM, run the Work with System Values (WRKSYSVAL) command, position the system value list to QSTRUPPGM and place an option 2 next to it. Then type in the new name of the program and its library. In our case, the program name was the same (QSTRUP), but the library was QGPL.
At the next IPL, the operating system looked into system value QSTRUPPGM to determine what program to run at startup, and consequently ran QGPL/QSTRUP. This procedure enabled us to start subsystem RBTSLEEPER at IPL and retrieve the CL code of the startup program for future modifications.
- Joe Hertvik