1 2 1 LODRUN command and the QINSTAPP program

Deploy LANSA Applications on IBM i

1.2.1 LODRUN command and the QINSTAPP program

To start with let's have a look at how the LODRUN command works.

The IBM supplied Load and Run Media Program (LODRUN) command restores a user-written program object from tape, diskette, or optical device into the library QTEMP. The system passes the device name to the restored program and transfers control to the restored program.

When the LODRUN command is executed:

1.  The media is searched for the user-written program, which must be named QINSTAPP and saved from library QTEMP.

2.  The QINSTAPP program is restored to the QTEMP library using the RSTOBJ command.

3.  Control of the system is passed to the QINSTAPP program. The QINSTAPP program can be used, for example, to restore other applications to the user's system and run those applications.

Note: The program QINSTAPP must be owned by a user profile that resides on the target system. If QINSTAPP is restored to a system that does not have the owning user profile, control is not transferred and the program is not run.

4.  When the user logs off, the QINSTAPP program is removed from the system.

The QINSTAPP program is not supplied by LANSA.

When you supply a QINSTAPP program, you are responsible for writing and supporting it. The 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.

    Apply fixes to existing applications.

The QINSTAPP program is run only once each time the LODRUN command is entered. The LODRUN command has only one mandatory parameter (DEV), which specifies the device from which the QINSTAPP program is restored.

For example: Restore the Program QINSTAPP from a DVD

LODRUN  DEV(OPT01) 

This command restores the program object QINSTAPP from the DVD on device OPT01 to the library QTEMP. The filename for the QTEMP library on the DVD is APP1/INST/QTEMP. Control is then transferred to the restored program. If the file is not found, an escape message is sent.

To install LANSA and your application, your QINSTAPP program may be structured to look something like this:

PGM PARM(&DEV)

 

*restotr the command LSISETUP and DC@LCP060

RSTOBJ     OBJ(LSISETUP) SAVLIB(DCXISVLIB) +  

             DEV(&DEVNAME) RSTLIB(QTEMP) +    

             OPTFILE('/AS400/LOADLIB')        

                                              

RSTOBJ     OBJ(DC@LCP060) SAVLIB(DCXISVLIB) + 

             DEV(&DEVNAME) RSTLIB(QTEMP) +    

             OPTFILE('/AS400/LOADLIB')        

* Setup environment

LSISETUP DEVICE(&DEVNAME)

 

* Install LANSA

LSIINSTALL PGMLIB(&PGMLIB) CONNIDN(4695)

* Install LANSA Integrator

LSIINTINS …

 

* Clean-up the work environment

LSICLEANUP

* Install your application

LANSA IMPORT(MYAPPINST)

ENDPGM

 

Refer to IBM documentation for more detail on the LODRUN command.

Ý 1.2 Create an Application Install Program