Das liegt an der Deklaration der Prozedur, die ein *PGM und kein *SRVPGM erwartet.

PROGRAM TYPE MAIN
Specifies that the routine executes as the main entry point in a program. The external program must be a *PGM object. PROGRAM TYPE SUB Specifies that the procedure executes as a procedure in a service program. The external program must be a *SRVPGM object.