Subroutines - run time errors

Ola caballeros.

Currently, PERFORMed subroutines are not flagged at compile time if the subroutine name doesn’t exist in the main program obstensibly because the subroutine can be defined externally (why doesn’t it check the external library at compile time?).

ANYHOW, I ask because a production program poorly tested and stowed six months ago just went down because a subroutine just invoked for the first time was misspelled.

Is there anyway to flag these situations with a WARNING when they exist ?

Thanks again for your help.

I have been burned by this, too. I wish there were a compiler option to issue warnings, but I can’t come up with anything. I would be happy if the compiler just listed all subroutines that are not defined internally.

You can do this yourself with LIST DIR, but that’s easy to forget.

Thanks so much for your response, Jerome. That works for me! I will publish …

To keep the logic consistent? If you CALLNAT or FETCH a module which doesn’t exist, you’ll also get a runtime error.

DDM, INCLUDEs, LOCAL or PARAMETER USING are evaluated at comile time.

What happens when I have :

Subprogram A, which CALLNATs Subprogram B which CALLNATs Subprogram C
which CALLNATs Subprogram A ???

What would be the order for STOW’ing???

As far as a warning, it has already been pointed out that LIST DIR gives you a list of Subprograms.

steve

Gentlemen, I am not suggesting that the STOW give errors, just warnings … yes, maybe even on the CALLNATs and FETCHes if the module (‘literals’ only check) or subroutine is not found in the library concatenation …

Wouldn’t that be nice ?