Debug Tool changes with Enterprise COBOL Version 5 and Version 6

Programs compiled with Enterprise COBOL Version 5 and Version 6 will have many debugging advantages over programs compiled with previous versions of COBOL when debugged with Debug Tool.

For details about Debug Tool interfaces with COBOL applications, see the documentation available at: https://www.ibm.com/support/docview.wss?uid=swg27048563#debugger.

Most of these differences apply to all debugging modes: full screen, batch, and remote. Complete details of Debug Tool commands are described in Debug Tool References and Messages.

DESCRIBE ATTRIBUTES commands

The PIC string shown in Debug Tool appears as it is specified in the source and not normalized as it was prior to Enterprise COBOL Version 5.

Level members are shown as written in the source code and not normalized as they were prior to Enterprise COBOL Version 5.

There are clearer data descriptions. For example, you could now see:
S9(5) SIGN LEAD SEP DISP  
instead of
S9(5) DSLS

DESCRIBE ATTRIBUTES shows the length and type of symbolic characters with Enterprise COBOL V5 and V6. With prior versions of the compiler, only zeros were shown.

For condition names (level 88) , an address of 000000000 is no longer shown.

There is more compact and clearer output for an array and array element. For example:
  • INDEX is displayed for type instead of IX
  • The level 00 is not displayed
  • There is no repetition of the type for each array element, the element type is shown only once.

Debug Tool no longer displays an address for DESCRIBE ATTRIBUTES of a register, such as %GPR0, because registers do not have addresses.

LIST command and AUTOMON output

LIST or AUTOMON of tables always shows the new Debug Tool, V12.1 option SET LIST BY SUBSCRIPT format.

When listing a record or group that contains a zero length ODO table, any data items that follow that table within the record or group are displayed. Previously, they were not.

No message is displayed for program entry when AUTOMONITOR is active.

Debug Tool variables of category Alphanumeric will be displayed within a pair of apostrophes. For example, if you execute LIST %SYSTEM, you will now see %SYSTEM = 'MVS'.

The output of LIST %HEX has improved. The output of LIST %HEX( var ) no longer shows %HEX in the output. Now the output is SBIN0_5 = X'00003039' instead of %HEX ( SBIN0_5 ) = X'00003039'. The X' indicates a hex representation.

The output of LIST varname no longer includes the block qualification. For example, the result could be varname = 5 instead of block_name ::>varname = 5.

The output of the LIST NAMES command now displays 01 and 77 level data items. In previous versions, all data items, including subordinate data items within a record or group hierarchy were shown. To see the entire expanded structure, use DESCRIBE ATTRIBUTES varname.

LIST NAMES LABEL now only displays labels in active blocks in nested programs. Previously, all labels for the program were displayed regardless of which block you were in.

LIST TITLED output for nested programs is modified. Now only variables in active blocks are displayed.

The formatted display of an array after the LIST command has changed for COBOL. When the elements of an array are groups, all members of that group are listed together for a given element, followed by the members of the group for the following element, and so on. Previously, a given member would be listed across all array elements, and then the next member of the group would be listed across all array elements. The keyword SUB is no longer displayed.

AUTOMONITOR output shows ADDRESS OF var and LENGTH OF var as single references.

AT APPEARANCE and LIST NAMES CUS has changed. Debug Tool is aware of cus. For example, if the main program object in your application is MYMAIN, the main program is MYMAIN, and the second program in the program object is MYSUB1, you can stop at MYMAIN::>MYMAIN 1, you will see the following new behaviors:
  • When you issue LIST NAMES CUS, the display shows the program object MYMAIN, and both the main program MYMAIN and the subprogram MYSUB1.
  • When you issue an AT APPEARANCE breakpoint for MYSUB1, the breakpoint is accepted.

Enterprise COBOL V5 and V6 assigns a save area for each nested program. You can see these save areas with commands, such as LIST CALL.

MOVE, COMPUTE, IF commands

The MOVE and COMPUTE commands in Debug Tool have expanded to allow the same data types as the compiler for receivers and senders. This enhancement removes previous restrictions on the use of those commands.

The IF command has been expanded. Allowable comparisons for relational conditions are expanded in Debug Tool with Enterprise COBOL V5 and V6. The allowable comparison for relational conditions (involving data items, literals, and figurative constants) are implemented according to the Enterprise COBOL for z/OS® Language Reference.

Index changes also improve the use of these commands:
  • There is relative subscripting of index names with Enterprise COBOL V5 and V6.
  • To conform to COBOL language rules, you can no longer index an array with index data items.
  • To conform to COBOL language rules, you can no longer use IN or OF qualifiers for an index name.

STEP command

You can STEP and set breakpoints for the WHEN phrase of EVALUATE.

STEP OVER with PERFORM is now supported.

Support for COBOL types

Debug Tool now supports the correct maximum value in all binary data types. For example, an 8-byte, unsigned COMP-5 data item can contain a maximum value of 18,446,744,073,709,551,615, which is 20 digits.

INDEX (IX) and Arrays

With Enterprise COBOL V5 and V6, you cannot use a data item of type INDEX as a subscript. For example, if you have defined a data item as 77 IXDI1 USAGE IS INDEX, you cannot execute LIST ARR(IXDI1).

Index names are in the debug infomation in the same way as top-level (01 or 77) data items, although index names do not have level numbers. In earlier versions of Enterprise COBOL, index names are shown in the debug information along with table elements, like children of the array to which they belong. In Enterprise COBOL V5 and V6, index names are not shown when table information is listed, they are only shown when listed explicitly by name. This change is reflected in the output from the following commands:
  • LIST NAMES
  • LIST TITLED
  • DESCRIBE ATTRIBUTES (with no argument)

With Enterprise COBOL V5 and V6, you cannot qualify an INDEX name using the name of the array to which it belongs. You also can no longer qualify a containing group or record name, as if it were a subordinate data item. For example IX3 of REC1. This was possible with earlier versions of Enterprise COBOL.

Enterprise COBOL V5 and V6 supports an increment (+) or decrement (-) operator as part of the INDEX of an array. Enterprise COBOL V4 did not support this.

With Enterprise COBOL V5 and V6 programs, Debug Tool defaults to 1 if you do not specify the index of an array. With previous versions, Debug Tool listed all members of the array. If the array is declared as shown below, and you issue LIST X, Debug Tool only displays the first element in the array ARR(1) as LIST X(1). LIST ARR(n) will show X and Y for the specified index, and LIST ARR will show X and Y for all members.
05 ARR OCCURS 10
10 X PIC 99
10 Y PIC 99

For previous versions of Enterprise COBOL, when you list a single element of an array, the format of the output is as if it is an array of size 1. For Enterprise COBOL V5 and V6, the output is the same as a variable of the given type, not as an array of size 1.

Other changes

The AT CALL entry name is not supported for Enterprise COBOL V5 and V6.

Several changes are implemented for the DESCRIBE CUS command. These changes are:
  • New compiler name: IBM® COBOL 5.2.0
  • Time Stamp is displayed: * Compiler: IBM COBOL 5.2.0 2014/11/27 13:08
  • There have been many changes to compiler options.
  • The type of linkage is displayed: * Its linkage is Language Environment FastLink. This is the default linkage for the compiler.

Line numbering with the NUM option and sequence of programs is different with Enterprise COBOL V5 and V6. In prior versions, a batch compile (sequence of programs in a single source) with NUM and NOLIB, the line numbers start over in the second program. With Enterprise COBOL V5 and V6, the LIB|NOLIB option has been removed. The compiler behaves as though COPY, BASIS, or REPLACE statements are included in a program and searches for the specified library or libraries, and therefore the second program in a sequence has line numbers that continue from those of the first program.

Display of National data items will include N with Enterprise COBOL V5 and V6. For example: listing of 01 nat pic N(5) value "abcde" national is NAT= N'abcde' V4: NAT = 'abcde'.

The number of digits displayed in arithmetic expressions is different with Enterprise COBOL V5 and V6. The number of digits resulting from arithmetic operations are defined in the Enterprise COBOL for z/OS Programming Guide.

Sign is handled differently with Enterprise COBOL V5 and V6. The result of an arithmetic expression will have a sign if either operands are signed. In earlier versions, the sign of the result depended on the answer. The exception is the case of results from subtraction and unary minus which are always signed to guarantee correctness of the result.

If the program being debugged was compiled with the QUALIFY(EXTEND) option, Debug Tool will apply the new name resolution rules in any command that references a data item, for example, LIST, MOVE, COMPUTE, and other commands. This makes Debug Tool consistent with the compiler when it comes to resolving data item references.

Debug Tool has been updated to handle data items that have been defined with the VOLATILE keyword, allowing such data items to be used in all of the same commands as nonvolatile data items.