Diagnosing problems with expressions

The information in this section can help to diagnose problems with the following product functions:
  • expressions that are available in the Fast Path Online Analyzer/EP online data extract function

  • expressions that are available in Fast Path Reorg/EP DEDB change, unload, and reload functions

The operators and operands that are used within a script or an expression are converted by the command language parser into a sequence of small operational steps. These operational steps are encoded into binary codes (called pseudo-code ). This process is similar to the process that might be used by a programming language compiler to convert the source language into machine language. The generated pseudo-instructions are conceptually similar to actual machine instructions that might be executed by a CPU.

During execution of the product, the pseudo-code that is generated by the parser is executed (interpreted) as required. As the pseudo-code is executed, various conditions are tested to detect problems to ensure that invalid results are not generated. When one of these tests fails, an exception report is generated, and the command function terminates. The exception report is preceded by the following message:

BMC110300C <dbdname> <areaname> : Exception code <code (name)> occurred during processing of <keyword> expression coded for the <command name> command on row <row number> , column <column number>

The message contains the specific reason for the failure, identified by the exception code and its corresponding name.

The following table lists the exceptions that might be produced. The most common exceptions encountered pertain to the problems with data values (Data, Overflow, Divide).

Code

Name

Description

0001

Operation

invalid pseudo-instruction encountered

0005

Addressing

invalid data address encountered

0006

Specification

invalid data specification encountered

0007

Data

invalid data value encountered

0008

Overflow

value exceeds capacity of operand

0009

Fixed Divide

divide by zero (data-type F or X)

000B

Packed Divide

divide by zero (data-type P)

0010

Segment Trans

segment address not available

0012

Trans Specification

segment index invalid

0013

Structure Specification

structure index invalid

0015

Operand

run-time environment invalid

0019

Subscript

subscript out of range

0020

RBA Specification

invalid RBA value

0021

RBA Read

control interval read error

0022

RBA Write

control interval write error

0024

DMAC Lock

DMAC lock error

0028

Verification

VER function mismatch

0030

Stack full

register stack overflow

0031

Stack empty

register stack underflow

Message BMC110300C also identifies the failing script or expression by the keyword that is used and the position of the command containing that keyword. The remainder of the exception report provides detailed information needed for diagnosing the exact problem.

The contents of the exception report will vary, depending on the nature of the error. When possible, the product provides a specific diagnosis of the problem in a short summary report, such as the the following example.

 BMC110300C DBFSAMD3, CUSDB: Exception Code 007 (data) occurred during        processing of FIELDS expression coded for the OUTPUT command on         row 5,  column 7

 The error occurred at offset 006C while executing pseudo-instruction:
   006C    FF00   FF080019 05000004 00000000 00000000  LOAD  CUSTROOT.26:4P

 ********* Segment=CUSTROOT (at 7F5DD358)
           000000  0030C2D9 F0F260E3 F0F1D1C1 D4C5E240  *..BR02.T01JAMES *
           000010  E3C1E8D3 D6D94040 40F0F040 40404040  *TAYLOR   00     *
           000020  40404040 40404040 40404040 40404040  *                *
 ********* Concatenated key for target segment  (CURRSEGM) **********
           000000  C2D9F0F2 60E3F0F1 E4F1               *BR02.T01U1      *

This exception report identifies the pseudo-instruction that was being processed when the error was detected. In the preceding example, an error occurred at offset 006C while executing a LOAD instruction for the data field coded as CUSTROOT.26:4P (a 4-byte packed field starting in column 26 of the root segment). Apparently, a root segment has been read that does not contain a valid packed value in this field. This is followed by a snap dump showing the contents of the segment being processed and the concatenated key of the target segment. In this example, the target segment for the expression is CURRSEGM, even though the error occurred in a field from the root segment.

For other exceptions, the product produces a complete exception analysis, such as the following example. In this example, a decimal divide exception has occurred during processing of the FIELDS keyword from some OUTPUT subcommand (not shown). This exception is caused when an attempt is made to divide by zero.

 BMC110300C DBFSAMD3, CUSDB: Exception Code 00B (decimal divide) occurred         during  processing of FIELDS expression coded for the OUTPUT         command on  row 5,  column 7

 The error occurred at offset 00A2; pseudo-code generated for expression:
   0000    FF00   FF030002 02800002 00000000 00000000  LOAD  3:2C
   0012    FFF8   FF050000 02800002 00000000 00000000  STORE (OUTPUT).1:2C
   0024    FF00   FF030006 0500000B 00000000 00000000  LOAD  7:11P
   0036    FFF8   FF050002 0500000B 00000000 00000000  STORE (OUTPUT).3:11P
   0048    FF00   FF030011 05000008 00000000 00000000  LOAD  18:8P
   005A    FFF8   FF05000D 05000008 00000000 00000000  STORE (OUTPUT).14:8P
   006C    FF00   FF030006 0500000B 00000000 00000000  LOAD  7:11P
   007E    FFF8   FF030011 05000008 00000000 00000000  LOAD  18:8P
   0090    FFD8   FF040000 05000010 00000000 00000000  CONV(-1) (WORK).1:16P
   00A2    FF5D                                        DIV
   00A4    FFF8  FF050015 05000010 00000000 00000000  STORE (OUTPUT).22:8P
   00B6    FFFF   0000                                 EXIT  0

 ********* Concatenated key for target segment  (CURRSEGM) **********
           000000  C2D9F0F2 60E3F0F1 E4F1               *BR02.T01U1      *
 ********* Segment=CURRSEGM (at 7F542490) *********
           000000  0034E4F1 E4C10000 00000000 00415000  *..U1UA..........*
           000010  0C000000 00000000 0CF0F040 40404040  *.........00     *
           000020  40404040 40404040 40404040 40404040  *                *
           000030  40404040                             *                *
 ********* Working Storage (at 7F71B328) **********
           000000  00000000 00000000 00000000 4150000C  *................*
 ********* Output Data Area (at 7F71B340)
           000000  E4F10000 00000000 00415000 0C000000  *U1..............*
           000000  00000000 00000000 00000000 00        *.............   *
 ********* #EXE environment block (at 7F71B280)
           000000  10000020 7BC5E7C5 010000E0 00020006  *.....EXE........*
           000010  7F662188 00A20280 7F71B360 0002000A  *................*
           000020  00050007 13B176F4 7F6622D8 00000000  *.......4...Q....*
           000030  00000000 00000000 00000000 00000000  *................*
           000040  00000000 7F662058 7F6620F0 000000BA  *...........0....*
           000050  00000000 00000000 00000000 00000000  *................*
           000060  00000000 00000000 00000000 00000000  *................*
           000070  00000000 00000000 00000000 00000000  *................*
           .       .        .        .        .         .
           .       .        .        .        .         .
           .       .        .        .        .         .

This exception report identifies the offset of the pseudo-instruction that was being processed when the error was detected, followed by a detailed listing of all pseudo-code that was generated for the script or expression in error. While it is not necessary to understand the specific details of the pseudo-code to diagnose the problem, being able to identify the operation involved with the error might provide all required information. The example indicates that the error occurred at offset 00A2. Looking at the pseudo-code listing, you find that a DIV instruction was being processed. This is preceded by LOAD instructions for the dividend (006C), the divisor (007E), and a CONV(-1) instruction that modifies the size of the dividend in preparation for the division. The divisor is the data field coded as 18:8P (an 8-byte packed field starting in column 18 of the default segment). Apparently, in one of the input segments selected this field contains a zero value.

The exception report lists the concatenated key of the current segment (CURRSEGM), with the I/O area for that segment. The report indicates that the 8-byte field that is used as the divisor (at offset X‘0011’) in this segment has a zero value.

The exception report shows the current contents of the working storage used in script or expression evaluation (if any). It also shows the current contents of the output area being generated (if any); this would not be present for a WHERE expression because it does not produce an output area.

The exception report shows the current I/O area for all other database segments used in the expression. In the example, no database segments other than the target segment are referenced.

The exception report snaps the contents of the run-time expression environment block(#EXE). The content of this storage might be useful in diagnosing certain types of exceptions but is not needed in this example.




Was this page helpful? Yes No Submitting... Thank you

Comments