IBM i Global

IBM i 

A space for professionals working with IBM’s integrated OS for Power systems to exchange ideas, ask questions, and share expertise on topics like RPG and COBOL development, application modernization, open source integration, system administration, and business continuity.


#Power


#IBMi
#Power
 View Only
  • 1.  Report for enabled users only

    Posted Wed December 17, 2025 02:43 PM

    I'm attempting to get a report for specific user profiles that are enabled. I ran this command , DSPUSRPRF USRPRF(*ALL) OUTPUT(*OUTFILE) OUTFILE(LIBRARY/FILE), so I can create a query against it. I ran WRKQRY,  and under 'Select Records I put the following:  When I run the query I get no data???

     

    Michael Ruth

    iSeries(AS/400) Support – SiteOps IT North American MQ & RD

     

     

    CONFIDENTIALITY NOTICE: This email message (including all attachments) is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure, copying or distribution is strictly prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.

    PRIVACY NOTICE: Your privacy is important to us. To find out more about the information that Elanco may collect, how we use it, how we protect it, and your rights and choices with respect to your Personal Data, go to privacy.elanco.com

     



  • 2.  RE: Report for enabled users only

    Posted Wed December 17, 2025 06:11 PM

    SELECT *
        FROM QSYS2.USER_INFO
        WHERE STATUS = '*ENABLED';

    ... or variations thereof ... see https://www.ibm.com/docs/en/i/7.6.0?topic=services-user-info-view



    ------------------------------
    Jack Woehr
    Senior Consultant
    Seiden Group LLC
    Beulah CO
    3038478442
    ------------------------------



  • 3.  RE: Report for enabled users only

    Posted Thu December 18, 2025 08:05 AM

    Hello Michael,

    I think there is a logic issue producing your 'No result'. 

    The UPUPRF search criteria are looking for specific user IDs that consist of just those letters.  Combined with the AND - it means that all of the criteria must be met to produce results.  I would presume that you want IDs that are 'E' OR 'M' OR 'P' OR 'S' to be listed - not AND which looks for a user ID that will satisfy all of those single letters (which is not logically possible).  

    Also, since you used the EQ test - it will only look for a user ID that is 'E' OR 'M' OR 'P' OR 'S'.  You might want to change that test to LIKE  - 'E%' OR 'M%' OR 'P%' OR 'S%' to look for IDs that start with those letters (perhaps - just a guess).  

    Plus there is Jack's method as well - it takes out the step of the DSPUSRPRF command to an output file, giving you a view at that information.  It has been around since V7R3 (at least) - so depending on the age of your OS, it might be available.  

    The links give examples on the SQL statements to get at that data.  A little experimentation should get you what you are looking for using that service as well. 

    Good Luck!



    ------------------------------
    Aaron Brown
    ------------------------------



  • 4.  RE: Report for enabled users only

    Posted Thu December 18, 2025 08:11 AM

    Aaron

     

    I did use Jack's suggestion which worked but I am going to try your suggestion for future reference.  Thanks

     

    Michael Ruth

    iSeries(AS/400) Support – SiteOps IT North American MQ & RD

     

     

    CONFIDENTIALITY NOTICE: This email message (including all attachments) is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure, copying or distribution is strictly prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.

    PRIVACY NOTICE: Your privacy is important to us. To find out more about the information that Elanco may collect, how we use it, how we protect it, and your rights and choices with respect to your Personal Data, go to privacy.elanco.com

     






  • 5.  RE: Report for enabled users only

    Posted Fri December 19, 2025 07:52 AM

    I think you're missing the  '*' on the UPSTAT = '*ENABLED'



    ------------------------------
    Arlene Magat
    ------------------------------



  • 6.  RE: Report for enabled users only

    Posted Fri December 19, 2025 07:52 AM

    I think you're missing the * on the status; UPSTAT = '*ENABLED'



    ------------------------------
    Arlene Magat
    ------------------------------



  • 7.  RE: Report for enabled users only

    Posted Fri December 19, 2025 08:49 AM
    Edited by Michael Hoyes Fri December 19, 2025 08:53 AM

    Your query is looking for user profiles that are E, M, P, and S at the same time. What you really want is to test using UPUPRF LIKE 'F%' AND UPSTAT EQ '*ENABLED' OR UPUPRF LIKE 'M%' AND UPSTAT eq '*ENABLED', etc.  You have to repeat the stat check because of the or clause, and you want to match based on the first letter.



    ------------------------------
    Michael Hoyes
    ------------------------------