Used in Role Based Security. This program retrieves values for both a specified User Profile and a Model (reference) Profile. The two profiles are compared, keyword by keyword, and if the User Profile varies from the Model Profile a CHGUSRPRF command string is built (several of the keywords (e.g. SPCAUT) are lists, which means we can't just execute the CHGUSRPRF command; a string must be built and executed via QCMDEXC).
The following link takes you to the source code, written in beautiful CLP. This program is distributed under a Creative Commons license.