To debug online programs through command-line entry and the tmp directory
-
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.
-
If you installed Lawson Core Technology on an IASP,
at the IBM i command prompt, type
SETASPGRP IASPName
-
At the IBM i command line, type
CALL LAWENV
- Type the name of an Environment and press Enter.
-
If you installed Lawson Core Technology on an IASP,
at the IBM i command prompt, type
-
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, useqcompile -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)
-
Create a directory in the tmp directory in the IFS.
MKDIR '/tmp/dbg_UserProfile_ProgramName'
where UserProfile is the IBM i profile name of the user who will run the program and ProgramName is the name of the program, such as GL10.
-
Access the online form either through Lawson Interface
Desktop (LID) or Lawson for Infor Ming.le. When the user specified in the
MKDIR
command performs a transaction using the program, the transaction is effectively put on hold and a stream file called strsrvjob.txt is created in the /tmp/ dbg_UserProfile_ProgramName directory. The file contains the text for aSTRSRVJOB
command that will allow access to the job that runs the program. -
View the stream file.
EDTF ’/tmp/dbg_UserProfile_ProgramName/strsrvjob.txt’
- Copy the STRSRVJOB command from the strsrvjob.txt file and paste it to the IBM i command line. Press Enter.
-
Start debug. At the command line, type
STRDBG
and prompt it (F4). Make sure the library is the one where you compiled the source and that UPDPROD(*YES) is set. If the information is correct, press Enter. - When source listing appears, set break points (F6), then press F12.
-
Delete the the debugging directory and strsrvjob.txt
file in order to take the transaction off of hold. At the IBM i command
line, type:
DEL ’/tmp/dbg_UserProfile_ProgramName/strsrvjob.txt’
RMVDIR ’/tmp/dbg_UserProfile_ProgramName’
-
The debugger will appear if any break points are hit.
After you are finished with debugging, end debug and the service job.
At the IBM i command line, type:
ENDDBG
then
ENDSRVJOB