The basic gist of it is that subroutines have to be before the ENDPGM. If you screw up and put them after ENDPGM then the compiler ignores them. I haven't tested it but I bet you could type the 23rd Psalm after ENDPGM in an otherwise valid CL program and it would be ignored. That's only part of the problem. The other part is that instead of simply flagging it as missing the subroutine the compiler goes off into La-La land. IBM has now recognized this and will fix it. I guess the testing involved only correctly written programs. And not programs written by someone who simply went to GO CMDSUBR as their sole source for learning about subroutines in CL. I've learned to use a simple RETURN before my subroutines to give me a warm fuzzy about the end of the mainline before the start of the subroutines. Rob Berendt
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.