COBOL

COBOL

COBOL

COBOL is responsible for the efficient, reliable, secure, and unseen day-to-day operations of the world's economy.

 View Only

Debug Tool support for COBOL 5.1: Level 88 Condition Names

By Dan Zhang posted Thu April 02, 2020 12:42 PM

  

One of the the improvements you'll see when using Debug Tool compared to debugging earlier versions of Enterprise COBOL has to do with Level 88 Condition Names.

With previous versions of Enterprise COBOL, the LIST command will show you the value of the Level 88 Condition Name (TRUE or FALSE), but not the value of variable with which the Condition Name is associated. In order to see both of these values, you'd need to enter two LIST commands.

With Enterprise COBOL 5.1, a single LIST command will show you both the value of the Condition Name, and the value of the associated variable.

Here's an example using the following variable, VAR1, and its associated Condition Name ISNUMERIC:

01 VAR1 PIC X VALUE '4'.
   88 ISNUMERIC VALUES '0' '1' '2' '3' '4' '5' '6' '7' '8' '9'.

When debugging Enterprise COBOL 4.2, the LIST command produces the following output:

LIST ISNUMERIC ;
ISNUMERIC = TRUE

However, there are several values of VAR1 which could produce a result of TRUE for ISNUMERIC, and the above output doesn't tell you which value VAR1 actually has. In order to see this, another LIST command is required:

LIST VAR1 ;
VAR1 = '4' 

With Enterprise COBOL 5.1, a single LIST command will show you both the value of the Condition Name, and the value of the associated variable in parentheses:

LIST ISNUMERIC ;            
ISNUMERIC = TRUE (VAR1 = '4')

MOVE 'x' TO VAR1 ;

LIST ISNUMERIC ;            
ISNUMERIC = FALSE (VAR1 = 'x')

This is a usability improvement, allowing you to see more information with fewer commands. In future posts I'll explore other changes that help improve the efficiency and accuracy of debugging Enterprise COBOL.

0 comments
3 views

Permalink