Locking a user using nsc api

There is a way to lock a user using a API call like nscus ? (Unix aix 7.1 , security 8.3.2)

Yes, you can - at least if by lock you mean make a user inactive.

The code is generally like this:

PFUNCTION := ‘MO’
PUSERID := #IN-USER
PLOCKDATES(1,1) := DATX
*
CALLNAT ‘NSCUS’ PFUNCTION PUSERID PUSERID2 PRC PPFKEY(
)
PPARM PPARM1 PPARM2 PTEXT(*) PPARM3 PPARM4
PNSC-MESSAGE

This is based on one of the PGMUSnnn examples.

Thank you Brian, i will develop a daily batch routine to verify users who dont logon for “n” days and lock it out (i was thinking in the same type of lock when a user type a wrong password n times) but your solution looks better.