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 ?

Thanks,
Swan

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 http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat823mf/pg/pg_obj_prog.htm#Subroutine and here http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat823mf/sm/definesu.htm .

Cheers,

Graeme

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