Previous Topic Next topic Print topic


Field Wrap-Around

If, when using binary data items (that is, RM/COBOL COMPUTATIONAL-1 format items) an arithmetic operation gives a value which exceeds the capacity of the data item, and there is no ON SIZE ERROR clause, Studio Enterprise Edition wraps-around the value of the item. However, in RM/COBOL, the data item is set to the limit of its capacity.

You should specify an ON SIZE ERROR clause to highlight such problems.

Example

In RM/COBOL, the following lines of code result in the value +32767 being stored in the data item, CALC-ITEM. However, Studio Enterprise Edition sets CALC-ITEM to -32768:

01 calc-item         pic s9(4)  comp-1.

 procedure division. 
      .... 
     move 32767 to calc-item. 
     add 1 to calc-item.
Previous Topic Next topic Print topic