This example program can be saved to tape or optical media and then loaded on the system by using the Load and Run Media Program (LODRUN) command.
The LODRUN command passes control of the system to the program, which then performs the tasks written into the program.
This example program can be designed to accomplish many different tasks. For example, the program could:
PGM PARM(&DEV) /* "Device" is only Parm allowed */
DCL VAR(&DEV) TYPE(*CHAR) LEN(10)
DCL VAR(&MODEL) TYPE(*CHAR) LEN(4)
/* Can check for appropriate model number, release level, and so on */
RTVSYSVAL SYSVAL(QMODEL) RTNVAR(&MODEL)
IF (&MODEL *EQ 'xxxxx') THEN...
/* Install a library for new application (programs, data): */
RSTLIB SAVLIB(NEWAPP) DEV(&DEV) ENDOPT(*LEAVE) +
MBROPT(*ALL)
/* Install a command to start new application: */
RSTOBJ OBJ(NEWAPP) SAVLIB(QGPL) DEV(&DEV) +
MBROPT(*ALL)
END: ENDPGM