Page 1 of 1

DECIMAL-POINT IS COMMA.

Posted: Wed Oct 08, 2014 2:41 pm
by Amit Salvi
Hi,

I'm in a new project. I see a 'SPECIAL-NAME' used in the program, like this:

Code: Select all

ENVIRONMENT DIVISION.         
CONFIGURATION SECTION.        
SOURCE-COMPUTER.  IBM-370.    
OBJECT-COMPUTER.  IBM-370.    
SPECIAL-NAMES.                
    DECIMAL-POINT IS COMMA.   
I've not seen this in the previous project. I've compiled the program without it and it was all fine then what's te use of this in the program?

Re: DECIMAL-POINT IS COMMA.

Posted: Wed Oct 08, 2014 4:40 pm
by William Collins
A good place to discover what it does is the Enterprise COBOL manuals.

The reason for this is that many (all, I don't know) countries in Continental Europe, at least, don't write their numbers properly :-)

Whereas the absolute proper way to do it is*:

Code: Select all

1,385,481.00
They choose instead to write:

Code: Select all

1.385.481,00
Where the roles of the full-stop and comma are reversed. DECIMAL POINT IS COMMA is how you get COBOL to give the output in the correct format.

* this bit is just a joke

Re: DECIMAL-POINT IS COMMA.

Posted: Wed Oct 08, 2014 10:11 pm
by Amit Salvi
Thanks William. Yes, you are correct. I used to work for a US client before while now I work for a European client and found this new.

Thank you! :)