DECIMAL-POINT IS COMMA.

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
Amit Salvi
New Member
Posts: 5
Joined: Fri Jun 20, 2014 1:39 am

DECIMAL-POINT IS COMMA.

Post 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?
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: DECIMAL-POINT IS COMMA.

Post 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
Amit Salvi
New Member
Posts: 5
Joined: Fri Jun 20, 2014 1:39 am

Re: DECIMAL-POINT IS COMMA.

Post 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! :)
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”