From the course: COBOL Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Literal and figurative constants - COBOL Tutorial
From the course: COBOL Essential Training
Literal and figurative constants
- [Instructor] In COBOL, we can have both numeric and non-numeric literals where a literal is an exact value or a constant. The rules for numeric literals include; A numeric literal can be up to 18 digits long, it can begin with a leading or leftmost plus or minus sign, and it can contain a decimal point, but it may not end with a decimal point. A non-numeric literal is enclosed in apostrophes or quotation marks as specified by the compiler. And finally, a non-numeric literal may contain anything, including spaces, numbers, and even reserved words, but it cannot contain another apostrophe. In addition to literals, COBOL also have something called figurative constants. And they're reserved words that name and refer to specific constant values. Here are some of the more commonly used figurative constants. We have high values and low values. We've already seen high values as an indicator to indicate the end of file. We can…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
COBOL naming standards4m 9s
-
(Locked)
How to define types of data4m 37s
-
(Locked)
Comp-3 data types3m 40s
-
(Locked)
Literal and figurative constants4m 48s
-
(Locked)
Editing characters for writing reports5m 27s
-
(Locked)
Challenge: Create a sales commission report1m 33s
-
(Locked)
Solution: Commission report solution5m 59s
-
-
-
-
-
-
-
-
-