yes there is…
check out this wrksysval *sec qpwdexpitv
I think that with this system value you only force to expirer the pwd but to disaled the usrprf you will need to create a pgm that check the user and disaled the ones with expired pwd.
First, set system value QPWDEXPITV to whatever it should be set system-wide. Then set PWDEXPITV() to 45 days for the “certain users” that need that setting. That prepares the system for the basic programming that follows.
On a daily basis, run a simple program that does DSPUSRPRF *ALL OUTPUT(*OUTFILE) and read through the file. The records will tell you if a profile has a 45-day password limit and if the password has expired. If so, then run CHGUSRPRF STATUS(*DISABLED) for that user.
The profiles with 45-day password expiration limits will already have expired passwords, but the programming also disables them.