Peform statement

Hi All,

I have a query for PERFORM statement.

If we write PERFORM statement in our code and do not define subroutine. The program does not give compilation error but it gives run time error , my question Why it does not give compilation error ?


Hi Swan,

The reason that no error is generated at catalog time is because the compiler is assuming that you want to perform an external subroutine.

At runtime, Natural finds the external subroutine using an internal lookup table that maps the internal long subroutine name to the 8 character module name. The lookup table is updated when the external subroutine is cataloged.

You can RTFM here and here [url][/url] .



It’s similar to CALLNAT ‘NONEXIST’.
It results in a runtime error.