Microsoft KB Archive/40551
Level 78 Entries Are COBOL Version 3.0 Constants
PSS ID Number: Q40551 Article last modified on 04-20-1993
3.00 3.00a | 3.00 3.00a MS-DOS | OS/2
|The information in this article applies to:|
|- Microsoft COBOL for MS-DOS and OS/2, versions 3.0 and 3.0a|
Summary: Microsoft COBOL Versions 3.0 and 3.0a level 78 entries are constants. These entries go in the WORKING-STORAGE SECTION of the DATA DIVISION. They act just like constants in other languages in that they allow you to reference a literal value with an associated name. Wherever this constant-name is used throughout the program, the compiler will substitute the value of the literal. Level 78 entries do not require a PICTURE clause because they are not variables and do not result in any additional allocated memory for data. Unlike level 77 entries, level 78 entries can appear anywhere in WORKING-STORAGE without altering the structure of a group item.
More Information: This feature is not an ANSI 85 feature, but one that is particular to Microsoft COBOL Versions 3.0 and 3.0a and not guaranteed to be supported in the future or in other compilers of any standard. This feature is documented in the “Microsoft COBOL 3.0: Language Reference Manual,” Pages 2-20. In the following sample program, do not use a COBOL.DIR file, but rather compile and LINK as follows: COBOL CONSTANT.COB; LINK CONSTANT.OBJ; The following is CONSTANT.COB: $set MS“2” $set ANS85 DATA DIVISION. WORKING-STORAGE SECTION. 78 MY-NAME VALUE “IAN SMITH”. 78 CLEARSCREEN VALUE X“e4”. 78 MIDDLE-OF-SCREEN VALUE 1230. 78 BOTTOM-OF-SCREEN VALUE 2301. 78 NOTHING VALUE " ". PROCEDURE DIVISION. CALL CLEARSCREEN. DISPLAY MY-NAME AT MIDDLE-OF-SCREEN. DISPLAY NOTHING AT BOTTOM-OF-SCREEN. STOP RUN.
Additional reference words: 3.00 3.00a Copyright Microsoft Corporation 1993.