Midrange News for the IBM i Community

Posted by: Bob Cozzi
Rogue Programmer
Cozzi Productions, Inc.
Mass-Change of Object Owner
has no ratings.
Published: 05 Nov 2011
Revised: 23 Jan 2013 - 1611 days ago
Last viewed on: 21 Jun 2017 (4773 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

Mass-Change of Object Owner Published by: Bob Cozzi on 05 Nov 2011 view comments(10)

We have a situation where we have a USER that will no longer be signing onto the system. This often happens when Employees leave the company.

This User Profile owns all of the objects that they created on the system over the many years. So there are thousands of them in at least a dozen different libraries.

I'm wondering how shops handle this kind of thing; when I user leaves and their user profile owns objects? My solution was to write a RNMOBJOWN (Rename Object Owner) CL command that changes the owner of every object owned by User X to User Y.

SOLUTION: There is a DLTUSRPRF parameter that allows a mass-change of ownership. Specify the "Owner's Objects Option" and you can change the owner while deleting. Here's something I've been using but forgot about:


The only thing about this choice, is that it requires that you are deleting the old profile. I suppose that's fine, but in our case, they've embedded it into things like FTP scripts with customers/vendors so we can't really delete it as yet.

I also couldn't believe that after 30 years CHGOBJOWN is still NOT generic; thankfully the IFS-related CHGOWN command does support generic names and I've used it for a long time instead of CHGOBJOWN, but I used CHGOBJOWN under the covers for RNMOBJOWN.

Return to midrangenews.com home page.
Sort Ascend | Descend