IBM Support

Finding Unused Profiles

Troubleshooting


Problem

Customers may ask how to find out if a profile is being used. Usually they are looking to clean up some profiles. This document provides reports to assist finding unused profiles.

Resolving The Problem

Based on the last Sign On Date
 

1.

You need to build a file that contains the following user profile information:
 

DSPUSRPRF USRPRF(*ALL) OUTPUT(*OUTFILE) OUTFILE(QGPL/unused)



You can use any library/filename.

2.

Then start SQL. Sample statements follow:
 

STRSQL



A very basic report listing all users and their Signon date:

 
SELECT UPUPRF, UPPSOD FROM qgpl/unused
Sorted by Date:
 
SELECT UPUPRF, UPPSOD FROM qgpl/unused ORDER BY UPPSOD
Sorted by Date Descending:
 
SELECT UPUPRF, UPPSOD FROM qgpl/unused ORDER BY UPPSOD DESC
For just one user:
 
SELECT UPUPRF, UPPSOD FROM qgpl/unused WHERE UPUPRF ='ADAM'


The string in quotes ('ADAM') is case sensitive.

 

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=File
 
 

[{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CHyAAM","label":"Security"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]

Historical Number

496566804

Document Information

Modified date:
08 April 2026

UID

nas8N1013520