• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Admin Alert Feedback: Quicker Ways to Change Library Object Ownership

    January 25, 2006 Joe Hertvik

    In a recent column, I stated that since the Change Object Owner command (CHGOBJOWN) did not have an *ALL function, there was no easy way to change object ownership for every single object in a library without writing a program to do the job. I was wrong in that assumption, and several readers wrote in to show me two different ways to reach that goal. So let’s look at what they shared and how it makes an administrator’s job easier.

    The Challenge Is Met. . . Twice!

    As laid out last time, the challenge was to find a way to quickly change the object ownership on every single object in a library in order to meet the needs of a third-party software package. I solved that need by writing a CL program that used IBM’s Display Object Description command (DSPOBJD) to create a file of all the objects in my target library, which the program was able to read and use the CHGOBJOWN command to change object ownership for each object in that library.

    While the program wasn’t difficult to write (it only contained 12 lines of CL code), a prudent administrator never develops his own solution unless it is better than the solution that IBM provides. Several readers reminded me of this, and submitted two alternative solutions–one short and one long–that solve the problem in a more elegant fashion than I provided. (You live, you learn.) Here’s what they came up with.

    CHGOWN: The Short Road to Object Ownership Changes

    A number of readers alerted me to this solution, including Uno Ekberg, Vern Hamberg, K. Stoner, R. Vanhelvoirt and one reader who simply identified himself as Rob. These readers all reminded me that while CHGOBJOWN does not contain an *ALL function, the Change Owner command (CHGOWN) command does. But the kicker is that it is not obvious that you can use CHGOWN to affect all objects in a DB2 UDB library unless you are also familiar with the notation in OS/400’s Integrated File System (IFS). Let me explain.

    CHGOWN is usually used to change ownership for stream file data objects that reside in several places in the IFS, including:

    • In folders under the root (/) of the IFS
    • In shared folders in the QDLS file system
    • In folders and directories inside the QOpenSys file system

    Stream file data is usually stored in standard PC-based or Unix-based formats, where the file name is defined in terms of its folder path name followed by its file name. So a file called joe.txt residing in the ‘/home/joe’ folder under the IFS root (/) directory would be designated by the following IFS notation:

    ‘/home/joe/joe.txt’

    To change the ownership of that file, then, I could run the following CHGOWN command.

    CHGOWN OBJ(‘/home/joe/joe.txt’) NEWOWN(new_owner) RVKOLDAUT(*YES)

    And CHGOWN changes the object ownership for my file to the user ID specified in the New owner parameter (NEWOWN). By default, this command also revokes all authority to the object for the old owner through the Revoke Current Authority parameter (RVKOLDAUT), which is usually set to *YES.

    You can also use the CHGOWN command to change object ownership for native DB2 UDB objects, because they also reside in the AS/400 IFS under the qsys.lib file system. Like IFS stream file data, DB2 UDB object location can also be specified in IFS notation. To locate a file called JOE in the ITJUNGLE library on an i5 partition, for example, you would use the following IFS notation:

    ‘/qsys.lib/itjungle.lib/joe.file’

    Knowing this, it’s easy to use CHGOWN to change ownership for my DB2 UDB object. I simply execute the CHGOWN command like this:

    CHGOWN OBJ(‘/qsys.lib/itjungle.lib/joe.file’) + NEWOWN(new_owner)RVKOLDAUT(*YES)

    For some rules and information about designating DB2 UDB objects in IFS notation, see the IBM’s iSeries Information Center Integrated File System Introduction to Path Name Rules for CL Commands and Displays.

    To change the owner for all objects in the ITJUNGLE library, I can then modify this command with a wildcard designation of ‘*.*’ to designate all objects in that library, similar to how I would access all objects in a PC folder. To do this, I would run the command like this:

    CHGOWN OBJ(‘/qsys.lib/itjungle.lib/*.*’) + NEWOWN(new_owner)RVKOLDAUT(*YES)

    And with one command, I have changed ownership for each object in an entire library. This is the shortest way my readers have told me about so far to perform this task.

    PDM: The Second Fastest Way to Object Ownership Changes

    The second new solution to this problem was submitted to me by readers Bob Spicer and Richard Comstock. This technique harnesses the power of PDM to change the owner on multiple library objects at one time. This is a multi-step process but, once it’s set up, you can use it whenever you want, directly from your PDM screen. Here’s how this technique works.

    1.  Enter PDM from the green screen by typing in the Start PDM command (STRPDM).

    2.  On the AS/400 Programming Development Manager (PDM) screen that appears, select option 2, Work with objects.

    3.  The Specify Objects to Work With screen will appears. Enter the name of the library you want to change object ownership for in the Library parameter. Also be sure to specify *ALL in the Name, Type, and Attribute parameters on this screen, in order to be sure that PDM displays all the objects in the library you want to change. Press ENTER and the program will display all objects in that library on the Work with Objects Using PDM screen.

    4.  On the Work with Objects Using PDM screen, select F16 to enter the Work with User-Defined Options screen. On this screen, you can add extra one- to two-digit options for launching commands directly from entries on the Work with Objects Using PDM screen. Your new option to change object ownership will be available in addition to all the familiar PDM options that IBM already supplies, such as 2=Change, 5=Display, WS=Work with Submitted Jobs, SP=Work with All Spooled Files, etc.

    5.  On the Work with User-Defined Options screen, press F6 to create a new option for changing an object’s owner. This brings up the Create User-Defined Option screen To enter an option that uses the CHGOBJOWN command to change the object owner for the current entry on the screen, you could create a ‘CP’ option with the following command line:

    CHGOBJOWN OBJ(&L/&N) OBJTYPE(&T) NEWOWN(new_owner)

    The parameters &L, &N, and &T represent the library name, object name, and object type of the PDM object entry that you will be launching the ‘CP’ option from. Save the command and return to the Work with Objects Using PDM screen.

    By adding this new user-defined option, every time you type ‘CP’ in front of an object entry on the Work with Objects Using PDM screen, PDM will use the CHGOBJOWN command to change that object’s owner to the new_owner value defined in your ‘CP’ user-defined option.

    6.   To change the owner for all the objects in the library, place a ‘CP’ in front of the first object in the Work with Objects Using PDM list and then press the F13 key (Repeat), which will duplicate your ‘CP’ entry for every object in that library list. Once you see ‘CP’ in front of every object in the list, press the ENTER key and PDM will change the objects’ owner for all objects on the screen.

    This technique works but there are a few drawbacks. First, the new_owner is hard-coded in the ‘CP’ User-Defined entry, which means that if you want to change the new owner’s name, then you have to open and re-edit the entry. The second drawback is that PDM usage is starting to go down in the i5/OS and OS/400 world. With IBM’s encouragement, many programmers are switching to WebSphere Development Studio, which is a graphical interface that may not execute this option. But this technique will work in a pinch if you can not use the CHGOWN command or the CL program technique I wrote up in my last column.

    So Which Is the Best Technique to Use?

    For my money, the CHGOWN command is the best technique to use for changing the owner for every single object in a library. It’s easy to use and it requires no coding or modification when a parameter changes. This does not mean that the other two techniques are not without merit. The PDM technique shows us an easy way to add new user-defined options to the PDM environment, while the CL programming technique shown in my other column can easily be modified to perform any number of operations on all objects in a library.

    RELATED STORIES

    Changing Object Authorities and Ownership for an Entire Library

    IBM’s iSeries Information Center, Integrated File System Introduction to Path Name Rules for CL Commands and Displays

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    PERFSCAN

    Revolutionary Performance Management Software

    At Greymine, we recognize there is a void in the IT world for a dedicated performance management company and also for a performance management tool that’s modern, easy to use, and doesn’t cost an arm and a leg. That’s why we created PERFSCAN.

    PERFSCAN is designed to make your job easier. With revolutionary technology, an easy-to-read report and graphics engine, and real time monitoring, tasks that used to take days can now take minutes. This means you will know your system better and will be able to provide better service to your customers.

    OUR FEATURES

    PERFSCAN is full of robust features that don’t require you to take a three-day class in order to use the product effectively.

    Customizable Performance Reporting

    Whether you are troubleshooting a major system problem or simply creating a monthly report, PERFSCAN lets you select any combination of desired performance metrics (CPU, Disk, and Memory).

    User Defined Performance Guidelines

    No matter if you are a managed service provider managing complex systems in the cloud or a customer analyzing your on-premises solution, PERFSCAN gives you the flexibility to define all mission critical guidelines how they need to be.

    Understanding The Impact Of Change

    Tired of all the finger pointing when performance is suffering? PERFSCAN’s innovative What’s Changed and Period vs. Period analysis creates a culture of proof by correlating known environmental changes with system performance metrics.

    Comprehensive Executive Summary

    Creating performance graphs is easy. Understanding what they mean is another thing. With one mouse click, PERFSCAN includes an easy-to-understand executive summary for each core metric analyzed.

    Combined Real-Time Monitor And Performance Analysis Tool

    With PERFSCAN’s combined built in enterprise real-time monitor and historical performance analysis capability, you will always know how your mission-critical systems are performing.

    Cloud Performance Reporting Is Easy

    Managing performance for production systems in the cloud can be a black hole to many system administrators. The good news is PERFSCAN analyzes all core metrics regardless of the location. That’s why MSPs and customers love PERFSCAN.

    Detailed Job Analysis

    PERFSCAN shows detailed top job analysis for any desired period. All metrics are displayed in two ways: Traditional Report and Percentage Breakdown Pie Chart. This toggle capability instantly shows the jobs using the most system resources.

    Save Report Capability

    Your boss lost the report you gave to him on Friday. Now what do you do? With PERFSCAN’s save report capability, any report can be retrieved in a matter of seconds.

    Professional PDF Reporting With Branding

    Creating professional looking reports for your customers has never been easier with PERFSCAN. Branding for our partners and service provider customers is easy with PERFSCAN.

    Check it out at perfscan.com

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    T.L. Ashford:  BARCODE400 - the fastest way to create compliance labels directly from the iSeries
    COMMON:  Join us at the Spring 2006 conference, March 26-30, in Minneapolis, Minnesota
    Bug Busters Software Engineering:  Quality software solutions for the iSeries since 1988

    Vision Solutions Appoints New Executive VP of Sales and Marketing How Low Can You Go?

    Leave a Reply Cancel reply

Volume 6, Number 4 -- January 25, 2006
THIS ISSUE SPONSORED BY:

Advanced Systems Concepts
Gabriel Consulting Group
COMMON

Table of Contents

  • Today’s Special: Data Area Surprise!
  • Use SQL to Run PDM Options?
  • Admin Alert Feedback: Quicker Ways to Change Library Object Ownership

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • IBM i Delivers Sizable Benefits, Forrester Consulting Reports
  • SBOMs Will Come to IBM i, Eventually
  • IBM i Backup Provider Storagepipe Snapped Up By Thrive
  • Four Hundred Monitor, June 7
  • IBM i PTF Guide, Volume 25, Number 23
  • Power10 Boosts NVM-Express Flash Performance
  • Fortra Completes Postmortem Of GoAnywhere Vulnerability
  • Guru: Binding Directory Entries
  • How Does Your Infrastructure Spending Stack Up To The World?
  • IBM i PTF Guide, Volume 25, Number 22

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2023 IT Jungle