VS COBOL 2

This appendix describes how to convert VS COBOL2.

1. VS COBOL 2 Elements

VS COBOL 2 is processed only when the --enable-vsc2 option is used.

The following are elements used in VS COBOL 2 and how they are converted to COBOL.

  • SET statement

    Using UP BY or DOWN BY in a SET statement allows to use comp, zoned, and packed variables besides INDEX as a SET target.

    SET {INDEX, IDENTIFIER} UP BY integer
  • Zoned Decimal to string

    Allows MOVE from zoned decimal with a scale to a string.

  • COMP-2 MOVE Rounded

    Executes ROUNDED when executing MOVE on USAGE COMP-2.

    WORKING-STORAGE SECTION.
    01 FLOAT-POINT COMP-2.
    01 FIXED-POINT-1  PIC S9(1)V9.
    
    PROCEDURE DIVISION.
        MOVE 1.19999999999999999 TO FLOAT-POINT.
        MOVE FLOAT-POINT TO FIXED-POINT-1.
        DISPLAY 'FIXED-POINT: ' FIXED-POINT-1.

    The following is the result.

    FIXED-POINT: 12+