Debugging EGL applications
- Programs
- Web transactions
- Rich UI Handlers
- Select a preference to suspend the program. Click . Under Suspend Execution, click Stop at the first line of the initial run unit.
- Choose the file to launch, based on the UI technology:
- For web transactions, right-click EGLWebStartup.jsp and click .
- For batch programs, right-click the .egl file and click .
- For Rich UI, right-click the .egl file and click . For more information, see Rich UI debugging.
- Start the program.
- The code suspends at the first line of the run unit, and EGL asks if you wish you change to the Debug perspective. Click Yes.
- Click the Step Into button to move through the program
Debugging using JDBC for SQL access
- JDBC does not support two-phase commit. There are separate calls to the SQL manager and WebSphere® MQ (formerly MQSeries®) manager for commit and rollback. Therefore, if a problem occurs, it is possible for one resource to commit or rollback without the corresponding commit or rollback for the other resource.
- JDBC always runs dynamic SQL. Generated COBOL uses static SQL
except when you use the EGL prepare statement
or a table name host variable (tableNameVariables property
in the SQLRecord definition). Therefore, there are the following differences:
- In dynamic mode, single row select can result in more than one row being returned without setting sysVar.sqlData.sqlCode to -811. As long as there is only one row that satisfies the criteria you do not notice a difference. See the following sample technique for how you can address this difference if it is important to you.
- JDBC converts data that is defined on the host as a CHAR, DBCHAR, or MBCHAR SQL column with the "FOR BIT DATA" option. If you have this situation, set the asBytes property to YES for the field that corresponds to the SQL column that is defined as "FOR BIT DATA".
- Be sure to use the DATE, TIME, and TIMESTAMP primitive types when defining fields for SQL columns that contain these types. You can use the CHAR primitive type, as long as the CHAR variable has the sqlDataCode property set to indicate the type of the SQL column. You can also use CHAR without the sqlDataCode property, but when you omit the sqlDataCode, you must rely on the JDBC driver to convert the dates to CHAR format. For further information on sqlDataCode, see sqlDataCode
- Certain SQL information is not supported by JDBC:
- sqlLib.sqlData.sqlerrmc
- sqlLib.sqlData.sqlwarn[n]
- sysVar.sqlData.sqlerrmc
- sysVar.sqlData.sqlwarn[n]
More sophisticated debugging involves launch configurations, breakpoints, database connections, setting variable values, and other concepts. For an overview, see Stepping through an application in the EGL debugger.
Debug environment different from host
if (sysVar.systemType is debug)
// do nothing
else
// check for sysVar.sqlData.sqlCode = -811
end This enables you to include system-specific logic that is only valid on the host system.
For information on the keyboard differences, see the EGL function key mapping table in validationBypassKeys or helpKey.
If the host environment uses a different code page from the workstation, you might also want to change the code page used in the debugger. For details, see Character encoding options for the EGL debugger.
Debugging programs
To debug programs that do not run under JEE, you can start the debug session as described in Stepping through an application in the EGL debugger.
For information on EGL debugger commands, see EGL debugger controls. For more information on how build descriptor settings affect the EGL debugger, see How build descriptor settings affect the EGL debugger.