You can enable security history on the servers JDE.INI file. In the [SECURITY] section, set History=1. The system will create records in the F9312 table for each login/logoff.
You basically do what Hari has recommended, and then you join it to the users table (F00092?) based on User ID and flag only accounts that are in an active status (01).