Debugging Online Programs Through the WORK Command

To debug online programs through the WORK command, use the following steps:

To debug online programs through the WORK command

  1. If LAWENV is not called as part of your user profile’s sign-on program, you must call the LAWENV program to set the environment variables correctly.
    1. If you installed Lawson Core Technology on an IASP, at the IBM i command prompt, type

      SETASPGRP IASPName

    2. At the IBM i command line, type

      CALL LAWENV

    3. Type the name of an Environment and press Enter.
  2. Compile the program you want to debug. At the Qshell command line, type

    qcompile -D productline systemcode programcode

    Note: If you need to include modules in the compile, use qcompile -Dm productline systemcode programcode .
  3. End any jobs using the previously compiled version of the program. At the IBM i command line, type:

    CALL TMCONTROL PARM(’-rp’ Productline Program)

    Example (IBM i command line):

    CALL TMCONTROL PARM(’-rp’ LAWAPP9 PR14)

    Example (Qshell command line):

    tmcontrol -rp lawapp9 pr14

  4. Access the online form either through Lawson Interface Desktop (LID) or Lawson Portal, and perform a transaction.
  5. Access the job for the online form. At the IBM i command line, type:

    WORK Subsystem LATMProgramName

    where Subsystem is the same subsystem under which you compiled the program and under which you will be running the program, and where ProgramName is the alphanumeric program ID, such as GL10. After you enter this command, the "Work Subsystem Jobs" screen appears.

  6. Start debug on the appropriate program.
    1. Type S by the appropriate job. It will be an LATMProgramName job. You will not be listed as the user, but the time the job started can be a clue to the job you want to work with.

      The options available on the "Work Subsystem Jobs" screen include:

      Option Name Description
      4 End Will prompt ENDJOB.
      5 Work with Will work or display job if user has authority.
      O Other Jobs Will display a list of all jobs on IBM i for this user.
      S STRSRVJOB Will prompt to start debug on a program (STRSRVJOB, then STRDBG). STRDBG is executed with UPDPROD(*YES) and OPMSRC(*YES).
    2. Enter the name of the program to be debugged. Move the batch job to an active job queue (one not on hold or one in a subsystem) by entering the appropriate job queue name.
  7. When the source listing appears, press F12.
  8. Perform a transaction using the program you are debugging.
  9. When you are finished debugging the session, be sure to end debug and end the service job. On the "Work Subsystem Jobs" screen, press F15 to execute the ENDDBG and ENDSRVJOB commands. (You may need to reply to a "Job being serviced ended" message.)