Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Too many operands in one statement

Status
Not open for further replies.

tcorum

Technical User
Jul 6, 2001
49
US
First of all I know little about cobol but because I am the system administrator I am trying to find a solution to this problem so any help would be great. When trying to compile a program using Microfocus Server Express I get this error.

320 Too many operands in one statement

However the only thing that has changed about this compile is that we upgraded from Microfocus Cobol 4.1 to the latest version of Microfocus Server Express. I still have the old version up and running and the program still compiles fine there. I have contacted Microfocus on this and their response was reduce the number of operands because they have a limit of 999. I check the number of operands in the program and I only count 214. Can anyone help me shed some light on this?

Thanks,

TCorum
 
The error message seems to be complaining about one statement, while Microfocus is talking about the whole program?

Did the source code get corrupted somehow? A typo perhaps? Do you have a backup source file you can compare it to?

__________________________________________
Try forum1391 for lively discussions
 
Yes I have a backup that is still in production on a different server that runs Microfocus Cobol 4.1 and it compiles fine. I have moved the program over to the new upgraded environment running Microfocus Server Express and get the Operand error. Nothing is different between the two programs that I or file compare can see.

Thanks for your help!

TCorum
 
Do you have deeply nested IF statements, or complex formulas that are being COMPUTEd?

Many compilers have bugs around the IF and the COMPUTE statements.

You should offer to send the source code over to Microfocus. Let them compile it. I think they would be delighted to test it against their new compiler.

__________________________________________
Try forum1391 for lively discussions
 
And are the compile options and directives the same ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
TCorum,
Is the 320 a line number in the program, or is it the error number of the message?

As the message appears to be for one statement, I am trying to identify that statement. Is there anything in the compile that shows what statement is? If so, can you post the statement here?

Marc
 

If 320 is a line number, then be sure the source code is "cleanly" numbered. Perhaps what is labeled line 320 in source code is not line 320 to the compiler.
 
I have not yet used the later versions of Micro Focus. Do they have the "LIST" compile option. This option is the only way I am able to find some errors reported by the compiler. View the .LST file and search for the error. There you will find the source code referred to.
 
Earlier in this thread, someone mentioned checking your directives.

My *guess* is that the problem is that you have a nested statement and that a change in directives has changed out the compiler interpretes the "end" of a specific statement.

For example,

Accept ABC
On Exception
ACCEPT XYZ
End-Accept
Display "HERE"

Whether the "END-ACCEPT" matches the first or second ACCEPT (and whether the DISPLAY is part of the first ACCEPT or separate from it) is controlled by a dialect directive. (THis speciific syntax may or may not actually be "correct" - but I think it demonstrates the problem).

***

If you show us the full (all 214 operands) statement *AND* any statements that it is "nested in", then I think we may be able to help you better.

Alternatively, use the SETTINGS directive to cmpare *all* the directives in effect with the old and new compiler and determine what has changed.

Bill Klein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top