AS400 Debug Online Programs
To debug online programs through command-line entry, follow these steps:
- 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.
-
- At the IBM i command line, type
CALL LAWENV - Type the name of an Environment and press Enter.
- At the IBM i command line, type
-
- 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 .
- 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)
- Access the online form either through Lawson Interface Desktop (LID) or Lawson for Infor Ming.le, and perform a transaction.
- Start a service job for the program.
- 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.
- At the IBM i command line, type:
STRSRVJOB JobNumber/UserName/JobName
- Get the job information by typing at the IBM i command line:WRKACTJOB SBS(Subsystem)
- 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.
- When source listing appears, set break points (F6), then press F12.
- Perform another transaction with the online program.
- After finished with debugging, end debug and the service job. At the IBM i command line, type
ENDDBG
then
ENDSRVJOB