How to declare constants in cobol.
thats mean we can't change that value through out the program.
declare constants
-
- Posts: 6
- Joined: Wed Sep 08, 2010 2:27 pm
- Skillset: cobol,db2,jcl,cics,vsam
- Referer: in google
- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: declare constants
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.
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.
d.sch.
-
- Global moderator
- Posts: 3720
- Joined: Sat Dec 19, 2009 8:32 pm
- Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
- Referer: other forum
- Location: Dubuque, Iowa, USA
Re: declare constants
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.