Troubleshooting
Problem
Resolving The Problem
Based on the last Sign On Date
| 1. | You need to build a file that contains the following user profile information:
|
| 2. | Then start SQL. Sample statements follow:
Sorted by Date: Sorted by Date Descending: For just one user:
|
Another Option to see the Last Signed On date is by using USER_INFO_BASIC view:
Basic report listing all users and their Signon date:
SELECT AUTHORIZATION_NAME,
PREVIOUS_SIGNON
FROM QSYS2.USER_INFO_BASIC
Sorted by date in ascending format
SELECT AUTHORIZATION_NAME,
PREVIOUS_SIGNON
FROM QSYS2.USER_INFO_BASIC
ORDER BY PREVIOUS_SIGNON;
Sorted by date in ascending format
SELECT AUTHORIZATION_NAME,
PREVIOUS_SIGNON
FROM QSYS2.USER_INFO_BASIC
ORDER BY PREVIOUS_SIGNON DESC;
For just one user:
SELECT AUTHORIZATION_NAME,
PREVIOUS_SIGNON
FROM QSYS2.USER_INFO_BASIC
WHERE AUTHORIZATION_NAME = 'ADAM'
User not signed of for more than a year; Sorted by date in ascending order
SELECT AUTHORIZATION_NAME,
PREVIOUS_SIGNON
FROM QSYS2.USER_INFO_BASIC
WHERE PREVIOUS_SIGNON < (CURRENT_TIMESTAMP - 1 year)
ORDER BY PREVIOUS_SIGNON
Based on the Last Used Date
If you are using this report to identify 'unused' profiles, Last Signon is not the only thing to consider. Profiles can be used for things other than signon that would be impacted by deleting them (examples could be owning objects, adopted authority on programs, and so on).
In this case, it is a good idea to take a look at the Last Used date in the Object Description before deleting the profile. You can do something similar to the above; for example, use a different command and different field names; however, it would be the same idea:
DSPOBJD OBJ(*ALL) OBJTYPE(*USRPRF) OUTPUT(*OUTFILE) OUTFILE(QGPL/lastused)
STRSQL
SELECT ODOBNM, ODUDAT FROM QGPL/lastused
Like the samples above, you can Order By the Last Used date (=ODUDAT Last Used Date) or select for a certain user (ODOBNM = Object Name which will be the profile name in this case).
To get results output to print or file and then displayed to the screen:
STRSQL
F13 for Services
1. Change session attributes
SELECT output . . . . . . . . 2 2=Printer 3=FileHistorical Number
496566804
Was this topic helpful?
Document Information
Modified date:
08 April 2026
UID
nas8N1013520