Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

10/4/23, 10:13 AM Document 650738.

1
Copyright (c) 2023, Oracle. All rights reserved. Oracle Confidential.

E1: BSFN: Debugging a Business Function on AS/400 Server (Doc ID 650738.1)

In this Document

Purpose
Scope
Details
Debugging a Business Function On a Logic Server
Common Steps (for BSFN calls from interactive or batch processes):
For A BSFN Called From an Interactive Application:
For A BSFN Called from a UBE (Batch process):
Notes / Hints:

APPLIES TO:

JD Edwards EnterpriseOne Tools - Version 8.98 and later


Information in this document applies to any platform.
Check for relevance Sep-08-2015

PURPOSE

How can I debug a business function on the AS/400 server?

SCOPE

This document outlines how to debug a Business Function (BSFN) while it is running on an AS/400.

This information is provided to assist the debug process. It is not intended to be a Oracle-J.D. Edwards supported
process.

DETAILS

Debugging a Business Function On a Logic Server

An E1 Business Function or BSFN is created as a CMOD (or C module) object on an AS/400. These CMODs are contained in
a SRVPGM, or service program, which is the equivalent of a *.DLL in an NT environment (such as a workstation). The
Parent DLL for a BSFN (found in Object Librarian) is the corresponding SRVPGM for this BSFN when used on an AS/400.
For example, the B4200310 BSFN is contained in the CDIST.DLL on an NT system, and in the CDIST SRVPGM on an
AS/400. On an AS/400, the B4200310 is a CMOD.

Common Steps (for BSFN calls from interactive or batch processes):

1. Verify the name of the Pathcode library on the AS/400 for the environment in which you will debug.

2. Backup (typically using the CRTDUPOBJ command) the CMOD and SRVPGM objects. J.D. Edwards cannot
support objects created outside the OneWorld environment. To ensure compatibility with OneWorld, all
objects that will be modified outside of the OneWorld environment should be backed up prior to the
modification and then restored after the debug process is complete.

3. Your library list should include the following (Use the EDTLIBL command to see it):

Pathcode library Example of library names: PRODB732

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=6us5y22ve_298&id=650738.1 1/3
10/4/23, 10:13 AM Document 650738.1

System library B732SYS

4. Create the function using the CRTCMOD command. The parameters can be set as follows:

Module: BSFN name, for example B4200310


Library: Pathcode library
Source File: the SRVPGM, or DLL name. CFIN for example
Library: Pathcode library
<F10> for further options
Optimize: *NONE when you are debugging
Debugging view: *ALL when you are debugging
Target Release: V4R2M0 for B733 (can be V3R7M0).

5. Update the SRVPGM using the UPDSRVPGM as follows:


Service program: SRVPGM or DLL name. CDIST for example
Library: Pathcode library
Module: BSFN name, for example B4200310
Library: Pathcode library
<F10> for further options
Creation options: Use the following three options: *DUPVAR, *DUPPROC, *UNRSLVREF.
The + will allow you to enter in multiple values.

For A BSFN Called From an Interactive Application:

6. Set the connectTimeout parameter under the [JDENET] section higher (i.e. 3600) on the workstation
Jde.ini.
7. Find the JDENET process that your interactive session is using for running processes on the server (use
WRKACTJOB). Since you will typically debug in an environment when few users are also logged in, you
should be able to find the JDENET process by testing the program that you will debug. OW will try to use the
same JDENET process each time you perform this test. To find the correct process:

Test the application.


Set your current IFS directory to JDEB733 (the JDE directory for your release). To do so, use WRKLNK
and option 11 next to this directory. Then use option 5 to get into this directory.
Use DSPSTMF (display stream file) on the most recent logs (last in the list) in this directory. You
should find the call to the function you are trying to debug in the log (your function call may not show
if it is an embedded call – you may have to find the function that calls your function, etc). The job
number that is part of the log name is your JDENET process. NOTE: DSPSTMF is a command
delivered by J.D. Edwards.
Use WRKACTJOB, option 5 for the JDENET process and find the one which shares this job number
(upper right corner).
Record the Job, User and Number from this process.

8. Start a service job. Use STRSRVJOB and the Job, User and Number from the JDENET process.
9. Start debug. Use STRDBG for the JDENET_K process as the program. This will bring you into the debug
session in a Display Module Source screen.
10. <F14> to see the programs which are in debug. Your function will not show. Use the option 1 to add in a
line for your SRVPGM in the pathcode library (CFIN PRODB733 *SRVPGM).
11. Your BSFN should now show in the list. Use a 5 to display the source for this BSFN, and then set
breakpoints <F6>. Note your OW application will hang when the process enters Debug – check your client
access session to see if it has stopped at a breakpoint.
12. Run your test. When you are finished debugging, ENDDBG and ENDSRVJOB.

NOTE: Never press <F3> while a business function is executing in debug – this will end the program.
Allow the business function to complete PRIOR to ending debug. Failure to do so may result in data
corruption, unreleased memory, and an unstable JDENET_K process.

For A BSFN Called from a UBE (Batch process):

6. Place the jobq to which you will submit your job on hold (HLDJOBQ).
7. Submit the UBE. Find the job number (WRKJOBQ, you can find the jobq from Work With Servers in OW).
8. Start a service job. Use STRSRVJOB and the Job (R014021), User and Job Number (from 8 above).
9. Start debug. Use STRDBG:
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=6us5y22ve_298&id=650738.1 2/3
10/4/23, 10:13 AM Document 650738.1

Program: PRINTUBE
Update production files: *Yes

10. The STRDBG command will bring you to a Display Module Source screen. Use <F14> to see the
programs which are in debug (there should not be any yet). Use the option 1 to add in a line for the
SRVPGM which contains your BSFN. For example, B9800190 is in CRUNTIME:

Program: CRUNTIME
Library: *LIBL
Type: *SRVPGM

11. Release the jobq (RLSJOBQ). This will bring up a message indicating the serviced job has been release
from the job queue. Use F10 to get to a command line to set breakpoints.
12. From the command line, use the DSPMODSRC command to get back to the source code for your BSFN.
Set breakpoints using <F6>. When you have set all the breakpoints you wish, use <F12> until you get to
the screen indicating the serviced job has been released, and hit <Return> to start the job.
13. The system will bring up your debug session, stopping at the first breakpoint encountered. You can use
the function keys available in debug to step through the program, etc.
14. When you are finished debugging and have returned to a command line, ENDDBG and ENDSRVJOB.

NOTE: Never press <F3> while a business function is executing in debug – this will end the program.
Allow the business function to complete PRIOR to ending debug. Failure to do so may result in data
corruption, unreleased memory, and an unstable JDENET_K process.

Notes / Hints:

In debugging logic from a UBE, you can use the workstation Jde.ini [Network Queue Settings] UBEQueue parameter to
send your UBE to a specific jobq. This will affect all UBE’s submitted from that workstation.

In debugging logic called from an interactive application, you must run the BSFN on the server. You may need to create
and activate OCM mappings prior to testing. Often, several BSFN’s must be mapped together to successfully run on the
server. It is not safe to test mapping just the Master Business Function without knowing these dependencies.

To add additional modules to your debug session: DSPMODSRC and the <F14>. You will see the interface in Step 10 (for
the interactive call) above.

To display the value of a variable:

Integer or enumerated: EVAL [variable name] or <F11> cursor sensitive


String EVAL *[string name]:S, EVAL *[string name]:SRX
Mathnumeric EVAL *[variable name]

You do not need the * if the variable is not a pointer.

In B733, the AS/400 Jde.ini is in your system library, File INI member JDE. In B732, it is in your control library, File INI
with member JDE.

Didn't find what you are looking for?

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=6us5y22ve_298&id=650738.1 3/3

You might also like