Microsoft KB Archive/47349

Error 320-S “Too Many Operands in One Statement;” No Line #

PSS ID Number: Q47349 Article last modified on 04-20-1993

3.00 3.00a | 3.00 3.00a MS-DOS | OS/2

Summary: The error 320-S, “Too many operands in one statement,” can occur without giving a line number as to where the error occurs when compiling with COBOL Versions 3.0 and 3.0a. The section where the error occurs can be in the constants (level 78) of the WORKING STORAGE SECTION. This problem is encountered when there are many constants and several of the constants have line continuations.

More Information: Although the manual states that this is an error in the PROCEDURE DIVISION, you can encounter this error in the WORKING STORAGE SECTION when there are line continuations. This is because the lines that need line continuation are parsed into temporary variable space. Then, when the COBOL compiler tries to compile these operands, the data is too large for the buffer space and the error occurs. This is the same reason you can receive the error “Too many operands in one statement” in the PROCEDURE DIVISION. Please note in the following program that if the constants are displayed only once in the screen section, the error doesn’t occur, and when the line continuations are taken out, the program compiles without error.

Code Example
Working-Storage Section. 78 Transaction-Heading Value 'Type Num Date      Description -       '            Amount     Deed Rec'. 78 Budget-Heading Value '    Budget #1  Amount #1     Budget #2  Amount #2 -       '     Budget #3  Amount #3    '. Screen Section. 01 Activity-Screen. 05 Line 3  Column 1  Pic X(80) From Transaction-Heading. 05 Line 6  Column 1  Pic X(80) From Budget-Heading. 05 Line 9  Column 1  Pic X(80) From Transaction-Heading. 05 Line 12 Column 1  Pic X(80) From Budget-Heading. Procedure Division. Stop Run. Additional reference words: 3.00 3.00a Copyright Microsoft Corporation 1993.