Optional: Write a user-defined installation program for the target systems

Start of changeThe user-defined installation program performs tasks and sends the appropriate instructions to the operators at the target systems. It allows you to perform many installation tasks automatically and install customer-written applications at the target systems. End of change

To write the user-defined installation program, complete the following tasks:

  1. Include instructions in your program to restore objects on the target system. For a list of instructions you can include in the user-defined installation program, refer to Installation tasks for the target systems. You can include all of the instructions in your program or only those that apply to your distribution.
  2. Create and save your program in the QGPL library and call it QLPUSER. If the QLPUSER program already exists in the QGPL library, the system deletes the program during automatic installation before restoring the QGPL library. This ensures that the distribution media will control additional processing.
  3. When you finish writing your program, perform the following tasks:
    1. Test your user-defined installation program to ensure that it works as expected.
    2. Keep a copy of your program in one of your user libraries on the central system.
    3. If you have several target systems that need unique processing, create a separate program for each.

Example: User-defined installation program

Start of changeThe following control language (CL) program is an example of a user-defined installation program. It sends an instruction to the operator at the target system. It also restores a library that contains an application and copies the command to start the application in the QGPL library. The &DEVICE parameter in this example is the name of your media device. The &SUCCESS parameter is used as an indication of whether all licensed programs installed successfully.End of change

Note: Start of changeBy using the following code example, you agree to the terms of the Code license and disclaimer information.End of change
  PGM        PARM(&DEVICE &SUCCESS)
   DCL        VAR(&DEVICE) TYPE(*CHAR) LEN(10)
   DCL        VAR(&SUCCESS) TYPE(*CHAR) LEN(1)
   IF         COND(&SUCCESS *EQ '1') THEN(DO)
        SNDUSRMSG  MSG('Load the tape in ' *CAT &DEVICE *CAT +
                               'and press the Enter key.')
        RSTLIB SAVLIB(APP1) DEV(&DEVICE)
        CRTDUPOBJ OBJ(STRAPP1) FROMLIB(APP1)   +
                               OBJTYPE(*CMD) TOLIB(QGPL)
   ENDDO
   ELSE
        SNDUSRMSG  MSG('One or more licensed programs failed to +
                               install.')
  ENDPGM

Start of changeNext topic: Continue with the tasks in the checklist (step 6).End of change