Top
NetCOBOL V11.0 Syntax Samples
FUJITSU Software

1.15 DECIMAL-POINT IS COMMA Clause

Specifying the DECIMAL-POINT IS COMMA clause switches the meanings of the comma (,) and decimal point (.) when used in data descriptions.

000010 @OPTIONS MAIN
000020*----------------------------------------------------------------------
000030* The DECIMAL-POINT IS COMMA clause is used to switch the meanings of 
000040* the comma and decimal point.
000050*----------------------------------------------------------------------
000060 IDENTIFICATION         DIVISION.
000070 PROGRAM-ID.            SAMPLE.
000080 ENVIRONMENT            DIVISION.
000090 CONFIGURATION          SECTION.
000100*----------------------------------------------------------------------
000110* The DECIMAL-POINT IS COMMA clause is specified.
000120*----------------------------------------------------------------------
000130  SPECIAL-NAMES.
000140          DECIMAL-POINT IS COMMA.
000150*----------------------------------------------------------------------
000160 DATA                   DIVISION.
000170 WORKING-STORAGE        SECTION.
000180 01 Distance-traveled   PIC 9(4).
000190 01 Fuel-consumed       PIC 9(3).
000200*----------------------------------------------------------------------
000210* The decimal point is represented using a comma.
000220*----------------------------------------------------------------------
000230 01 Fuel-cost           PIC 999,99.
000240*----------------------------------------------------------------------
000250 PROCEDURE              DIVISION.
000260     DISPLAY "The fuel cost is calculated."
000270     DISPLAY "Please input the distance traveled.  (unit:  Km) >>"
000275              WITH NO ADVANCING.
000280     ACCEPT  Distance-traveled.
000290     DISPLAY "Please input fuel consumed.  (unit:  L) >>" 
000295              WITH NO ADVANCING.
000300     ACCEPT Fuel-consumed.
000310     COMPUTE Fuel-cost = Distance-traveled / Fuel-consumed
000320     DISPLAY "The fuel cost is " fuel-cost " Km/L."
000330 END PROGRAM SAMPLE.