Domanda

There were some 10 COBOL modules linked to 4 fortran modules. I converted the fortran codes to C programs. And linked the 10 cobol modules to the replacing 4 C modules.

In these 10 COBOL modules, there should be "ENTER C" statements replacing ENTER FORTRAN statements now. And after that while compiling, I found that two of these COBOL modules - throw error while compiling. Other don't.

The error I get is this: "Arithmetic expression too complex: Floating point used!" - and it points to similar lines in these COBOL modules. (I compiled using COBOL85)

The lines where the errors are pointed out, looks somewhat like this: COMPUTE D = L OF E / (( L + (A/100)) ** ( Z OF J(S-1)/365)) Here, the L,E,A,Z & J are possibly coming from the C program.

There were other lines pointed out too, that looks somewhat similar. Most common of those lines were the ** (exponential operator).

Note: These 10 COBOL modules compiled fine when linked with those fortran modules, so I'm to believe that the problem is with the equivalent C program that was written. Also I used the following changes in my C module when converting from FORTRAN.

INTEGER*8 to long int in C. DOUBLE PRECISION to DOUBLE in C. INTEGER to int in C.

What might be the issue here?

È stato utile?

Soluzione

A bit too unorthodox to answer my own question, but I just found the reason for the 'warnings' and I've cleared them. So for anyone else coming here with a similar warning, here's the answer.

That compute line was just too complex for COBOL85 compiler to handle. I split up the equation into small bits and then put them together and they worked like a charm!

So there goes! No data type issues, or anything at all, actually! Thanks for all those who tried to help, btw. Much appreciated! :)

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top