declare constants



declare constants

Postby swapna namburu » Fri Sep 10, 2010 12:20 am

How to declare constants in cobol.
thats mean we can't change that value through out the program.
swapna namburu
 
Posts: 6
Joined: Wed Sep 08, 2010 2:27 pm
Has thanked: 0 time
Been thanked: 0 time

Re: declare constants

Postby dick scherrer » Fri Sep 10, 2010 12:24 am

Hello,

Anything that can be "declared" can be modified. . .

It is the responsibility of the programmer to ensure that values that are to remain constant are not modified.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: declare constants

Postby Robert Sample » Fri Sep 10, 2010 12:28 am

COBOL has a few figurative constants (such as ZERO, SPACE, HIGH-VALUES, LOW-VALUES) however it does not have the ability to declare constants as non-changeable values per se. What are you wanting to do, specifically? Perhaps there's a way to achieve your goal without requiring constants.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to Stupid Questions