CL Programming

Responsibilities of the Application Writer

The user supplying the QINSTAPP program is responsible for writing and supporting it. The QINSTAPP program is not supplied by IBM*. The program can be designed to accomplish many different tasks. For example, the program could:

Figure 6-2 shows an example of a QINSTAPP program. The program is saved to a tape or diskette by the program writer and loaded on the system using the LODRUN command. The LODRUN command passes control of the system to the program, which then performs the tasks written into the program.

Figure 6-2. Example of an Application Using the LODRUN Command

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


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]