Getting modules to adopt authorities from the main program

I have a program with modules that does user profile maintenance. QSECOFR owns the main program and a "security" group has adopted authority to the main program. But there are two modules that do a CHGUSRPRF. These modules abend because the user does not have SECADM. I want the modules to adopt the authorities from the main program. How do I do that?
The easiest way to solve your problem is to set your modules (Service Program) to adopt authority too.
Assuming that the owner of your programs are QSECOFR…

The command you use to set your main program to adopt authority is CHGPGM. For example:

CHGPGM PGM(MYPGM) USRPRF(*OWNER)

The modules associated with the main program are service programs though and you will need to set them to adopt authority using the CHGSRVPGM command. For Example:

CHGSRVPGM SRVPGM(MODULE1) USRPRF(*OWNER)

CHGSRVPGM SRVPGM(MODULE2) USRPRF(*OWNER)

That's all there is to it….

This was first published in April 2008