How to use Debug on JDE Program

ibilima

Member
I am getting unexpected results in a field and would like to step through the program with a debugger. The program(P43500) is called from a CL(J43500). Have tried STRDBG and JDEDBG. Programs will run but not go into debug mode.
 
This only applies to the STRDBG cmd. From a command line, type "go cmddbg". Page down, place your cursor on the line for the strdbg cmd, and press F1. There are restrictions at the end of the Help text. Do you meet all requirements to use the command? I don't know if you'd get an errmsg if you don't, but I'd expect to see errors in my joblog if I didn't meet the requirements.
 
I have used ISDB many times on other programs...but not JDE ones. I have SECOFR security. I have tried JDEDBG instructions from the internet also. When I bypass the CL(J43500) and try to debug P43500 passing the parms indicated in the CL, it complains about not having the parms. call pgm(p43500) parm('p43500' 'ibi0001r')
 
Review the source for J43500 as it calls P43500. You may need to specify more parameters than just the DW Form ID & the Version ID.
 
[ QUOTE ]
I have used ISDB many times on other programs...but not JDE ones. I have SECOFR security. I have tried JDEDBG instructions from the internet also. When I bypass the CL(J43500) and try to debug P43500 passing the parms indicated in the CL, it complains about not having the parms. call pgm(p43500) parm('p43500' 'ibi0001r')

[/ QUOTE ]


Debugging JDE World programs interactively can sometimes be tricky.

For a batch program like P43500 there is usually a CL driver (in this case J43500) which takes two parms (Program ID and Dream Writer Version).

Before calling P43500, the J43500 CL driver performs a shared override on the based-on file (in this case F4311) and calls P98315 which executes the OPQNQRYF command to filter and sort the F4311 file by using the Record Selection values and Field Sequence specified in the Dream Writer version.

Also, many of the CL drivers for JDE batch programs are written in in a fashion which prevents interactive execution of the batch program.

If the J43500 CL driver contains this feature, the program retrieves the job type into a variable named &JOBTYPE, and checks job type to see if it is being executed interactively.

If interactive execution of the program is prohibited (i.e., if &JOBTYPE = '1') then the program will abort, so it might be necessary to debug the CL driver, set a breakpoint where it tests &JOBTYPE, and change &JOBTYPE to '0' at the appropriate spot to allow it to continue executing for your interactive debug session.

Since we spoke on the telephone and I know a bit about your environment, here are the step by step instructions for debugging the J43500/P43500:

1) To ensure that the source and objects match:

a) Use SVR or CRTCLPGM to compile J43500 into your test library.

b) use SVR or CRTRPGPGM to compile P43500 into your test library.

2) From the JDE menu program, call QCMD to go to the IBM command line.

3) This step may /not/ be necessary for a JDE batch program, but it is necessary when debugging a JDE interactive program

( Remember my comment about JDE's "security by obscurity" ? ).

In any case, it will not cause any harm while debugging a batch program - on the IBM command line execute this command:

CHGDTAARA DTAARA(QTEMP/VTTL@) VALUE('X')

4) Now ensure that your test library is above any other library which may contain a copy of J43500 and P43500.

I normally use EDTLIBL and put my test library right after QTEMP in the library list, if QTEMP is near the top.

5) Since these are both OPM programs, you can now use the STRISDB command to debug them; If J43500 does NOT check &JOBTYPE, then you can now start debugging P43500 with this command:

STRISDB
PGM(P43500)
UPDPROD(*YES)
INVPGM(*CMD)
CMD(CALL PGM(J43500) PARM(P43500 YOURVERSION))

6) When finished sign off to clean up the temporary objects which were created in QTEMP - this will also close the F4311 file in the event that P43500 bombed and ended abnormally while you were debugging it.


If you need further help, you have my phone number - feel free to call me tomorrow.

Best Regards,
 
Vanilla JDE programs are not able to be run in debug. You should take a copy of the source code and compile it in a temporary library (not a production library) Then you can debug the new compiled program. To need to make sure that the library list has the new compiled program on top.
 
Back
Top