LODRUN

183 Views


Loading and running an application from tape or optical media

The Load and Run Media Program (LODRUN) command loads and runs an application written by another user or by a software vendor from tapes or optical media that is supplied by the other user.


When the LODRUN command is run:

  • The media is searched for the user-written program, which must be named QINSTAPP. 
  • If a QINSTAPP program already exists in the QTEMP library on the user's system, it is deleted.
  • The QINSTAPP program is restored to the QTEMP library using the Restore Object (RSTOBJ) command.
  • Control of the system is passed to the QINSTAPP program.

Example: QINSTAPP program

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:

  • Restore and run other programs or applications
  • Restore a library
  • Delete another program or application
  • Create specific environments
  • Correct problems in existing applications
    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

     

Post Comments