Error Handling and Debugging Tools

  1. ACCENT R System Field @AUX contains a 5 character string that is a key to the last error that occurred when processing an auxiliary data set.  The field is set to "NO" at the beginning of each ACCENT session and is reset to "NO" before each operation on an auxiliary data set.

Refer to Appendix B for the explanation of each string.

Use the following FORTRAN code as a model of how to test this value:

character*5 iaux
integer*4 ier,idesig

call accini(%descr(ier)'trace','FORTRAN')
call accdbl(%descr(ier),'trace','ORDENT')

call accopn(%descr(ier),'trace+input','ds','PROD',%descr(idesig))

do 100 knt = 1,100
call accget(%descr(ier),'trace+next',%descr(idesig),' ')

call accloa(%descr(ier),'trace',%descr(0),'@AUX',%descr(iaux))
if (iaux .eq. 'MISSI') goto 900

...

100   continue

900   call acccls(%descr(ier),'all')

call accend(%descr(ier))
end

  1. Test for non-zero error codes returned into the host variable (first argument for all HLI calls).

Refer to Appendix C for the error codes, and their corresponding message.

  1. HLI trace facility - Enabling the HLI TRACE facility is a very powerful debugging tool.  It prints a message indicating which HLI routine was called, and resolves all the arguments showing what values are actually being passed.  After the HLI call statement is printed, the return code is shown.

This trace information can be used in conjunction with any error messages since the error message shows which argument caused the error to occur.

Some of the tracing information contains 2 character codes instead of the actual values.  For example, the ‘error_code’ argument shows IN.  The following is a list of the 2 character codes and their significance:

IN - integer

DP - double precision

NS - numeric string

RE - real

ST - character string

UN - data type unknown to ACCENT R

  1. Set up HLI trace for the entire session.

Set a non-zero value to the system field @HLI_TRACE.  This causes all HLI calls to display trace information.  Tracing can be disabled for a particular call by specifying the NOTRACE option.  The FORTRAN code to test @HLI_TRACE is shown below.

call accsto (%descr(ier),'trace', %descr(0), & '@HLI_TRACE',%descr(1))

  1. Turn on HLI trace for specific calls.

  1. NOHUSH option.

The HUSH option shuts off warning, error and auxiliary messages for the current statement.  When debugging, these messages provide useful information as to possible error conditions.  Specify the NOHUSH option during the development phase, and this can be changed to HUSH for the production environment.

Even with the NOHUSH option enabled, the values of @AUX and error_code are still set and can be used to test for error conditions.