AS400 Debug Online Programs

, ,

To debug online programs through command-line entry, follow these steps:

  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. At the IBM i command line, type
        CALL LAWENV
      2. Type the name of an Environment and press Enter.
  1. Compile the program you want to debug. At the Qshell command line, typeqcompile -D productline systemcode programcode

Note: If you need to include modules in the compile, use qcompile -Dm productline systemcode programcode .

  1. 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)

  1. Access the online form either through Lawson Interface Desktop (LID) or Lawson for Infor Ming.le, and perform a transaction.
  2. Start a service job for the program.
    1. Get the job information by typing at the IBM i command line:WRKACTJOB SBS(Subsystem)

      Find the appropriate LATMProgramName job in the appropriate subsystem, and then select option 5 (Work with). Select option 1 to confirm that it is the correct job. If it is correct, return to the previous screen and note the job number, user name, and job name (which will be LATMProgramName).

      Note: You can also use the WRKSBS command to find the appropriate subsystem and then LATMProgramName job.

    2. At the IBM i command line, type:

      STRSRVJOB JobNumber/UserName/JobName
  1. Start debug. At the IBM i command line, type STRDBGand prompt it (F4). Make sure the library is the one where you compiled the source. If the information is correct, press Enter.
  2. When source listing appears, set break points (F6), then press F12.
  3. Perform another transaction with the online program.
  4. After finished with debugging, end debug and the service job. At the IBM i command line, type

ENDDBG

then

ENDSRVJOB