IBM Support

Tool to List All Objects Owned by User

Troubleshooting


Problem

This program will list all objects owned by a user profile.

Resolving The Problem

Introduction

This tool was created to list all objects owned for a user profile. This becomes very useful when message MCH2804 - Tried to go larger than storage limit for object xxxx (where xxxx is the name of a user profile) is issued. The Display User Profile (DSPUSRPRF) command can be used to get a spooled file listing of library type objects (libraries and objects residing in libraries) owned by the profile; however, the resulting spooled file would not show any Integrated File System objects owned by the profile.
 
Caution: This tool is provided on an as is basis and is not supported by IBM.
Method 1(Preferred):  
The QSPTLIB can be obtained by using Option 22 from the GO MG menu on the QMGTOOLS library. For information on how to download QMGTOOLS, please refer to dcf # N1011297 or in the following link:

http://www.ibm.com/support/docview.wss?uid=nas8N1011297
Method 2:

This tool is now available as a command on a new menu provided by the PTF SE06946 which provides the ECS software support library for V5R2M0. The PTF was changed on 03/01/2004 to provide this new function. For V5R3M0, the PTF is SE16633. For V5R4M0, the PTF is SE24152. For V6R1M0 the PTF is SE32507. For V7R1M1 is SE45610.  For current releases, use Method 1.

The tool can be downloaded from the following site:

http://public.dhe.ibm.com/services/us/igsc/qsptlib/


The Support Tools Menu (GO SPTMNU) now has an Option 7. Security tools menu (SCTMNU) which provides the following options:
o Retrieve owned object list for a user
o Retrieve private authorities for a user
This new menu can also be using the command GO SCTMNU.

Option 1 of the menu provides the tool via the command Retrieve owned object list (RTVOBJLST) that looks similar to the following:

User profile name  . . . . . . .                 name                
Object authorities output file     QOBJAUT       QOBJAUT, name        
  Library  . . . . . . . . . . .     *CURLIB     *CURLIB, name        
  Member . . . . . . . . . . . .   *FIRST        *FIRST, name        
  Replace or add records . . . .   *ADD          *ADD, *REPLACE      
Integrated File System authorities output file  . .   QIFSAUT       QIFSAUT, name        
  Library  . . . . . . . . . . .     *CURLIB     Name, *CURLIB        
  Member . . . . . . . . . . . .   *FIRST        *FIRST, name        
  Replace or add records . . . .   *ADD          *ADD, *REPLACE      
Delete user spaces . . . . . . .   *YES          *YES, *NO, *YES, *NO

or press F11 to enable the parameter names to be displayed:

User profile name  . . . . . . . USRPRF                      
Object authorities output file   TOFILEA        QOBJAUT      
  Library  . . . . . . . . . . .                  *CURLIB    
  Member . . . . . . . . . . . . OUTMBRA        *FIRST      
  Replace or add records . . . . MBROPTA        *ADD        
Integrated File System authorities output file  . . TOFILEB        QIFSAUT      
  Library  . . . . . . . . . . .                  *CURLIB    
  Member . . . . . . . . . . . . OUTMBRB        *FIRST      
  Replace or add records . . . . MBROPTB        *ADD        
Delete user spaces . . . . . . . DLTSURSPC      *YES    

The User profile name field must receive a value. All other fields can remain the default values.

When the command is run, a file specified by the parameter TOFILEA will be created to contain information for library type objects owned by the named profile. Similarly, a file specified by the parameter TOFILEB will be created to contain information for Integrated File System type objects owned by the named profile. One or more user spaces will be created in the same libraries. The user space objects will be deleted prior to completion if the DLTUSRSPC parameter is set to *YES.

Running the Tool

The command can be run interactively or submitted as a batch job. Run the RTVOBJLST command described above. If the named profile has a large number of owned objects, the program can run for hours. Consequently, running the program in batch mode is recommended. The tool does not get a lock on the user profile being processed.

Library objects:
The tool calls the API QSYLOBJA repeatedly, with format OBJA0100, to obtain a list of all library objects (libraries and objects in libraries) which the specified user:
o Owns
o Is authorized to
o Is the primary group
If there are too many such objects for QSYLOBJA to pass back in one user space object, QSYLOBJA is called again as many times as is necessary. Each call to QSYLOBJA is preceded by creation of a user space having a name of the form US0100nnnn where nnnn starts with 0001 for the first user space and is incremented as necessary. The tool also creates a physical file based on the OBJA0100PF template file which is a member in source file QSPTSRC in library QSPTLIB. This file will be named and reside in a library as specified by the TOFILEA parameter. All the fields from the OBJA0100 format are in each record of the TOFILEA file.

Among the various library objects which can be reported are document objects that will be reported as *DOC type objects in library QDOC. The object name reported is the *SYSOBJNAM, rather than the document name in the folder the document resides in. The following command can be used to identify the folder name and document name:

DSPDLONAM DLO(*SYSOBJNAM) SYSOBJNAM(LBZP402412)

The object name from the output file is used as SYSOBJNAM.

Integrated File System Objects

The tool calls API QSYLOBJA repeatedly with format OBJA0110 to obtain a list of all Integrated File System objects that the specified user owns, is authorized to, or is the primary group. If there are too many such objects for QSYLOBJA to pass back in one user space object, QSYLOBJA is called again as many times as is necessary. Each call to QSYLOBJA is preceded by the creation of a user space having a name of the form US0110nnnn where nnnn starts with 0001 for the first user space and is incremented as necessary. The tool also creates a physical file based on the OBJA0110PF template file which is a member in source file QSPTSRC in library QSPTLIB. This file will be named and reside in a library as specified by the TOFILEB parameter. All the fields from the OBJA0110 format are in each record of the TOFILEB file.

The L1OWNRSHP field in the TOFILEA file and the L2OWNRSHP field in the TOFILEB file indicates whether the user owns the object or is the primary group for the object. If the user owns the object, this field is Y. If the user is the primary group for the object, this field is G. Otherwise, this field is N to indicate a private authority. Only records with a L1OWNRSHP/L2OWNRSHP value of Y or G will be included in the output files.

One of the pass-back fields of the OBJA0110 format is the full path name of the directory object. The maximum length of a path name on the system is 16 megabytes. It is impractical, and most likely unnecessary, to create a physical database file capable of storing path names of such length. Therefore, the OBJA0110PF DDS is being released with a length of 512 characters for that field. The command program checks each path name passed back via the user space object. It also stores in the OBJA0110PF physical file record up to 512 characters of each full path name. If a path name is longer than 512 characters, a path truncated flag is set to signal that the path was truncated. The command program saves the additional information which enables another program to access the full path name directly from the user space objects, assuming the user had specified a DLTSURSPC value of *NO when invoking the command. The fields of interest here are the following:
 
L2US 10A TEXT('NAME OF USRSPC')
L2USLIB 10A TEXT('NAME OF USRSPC LIBRARY')
L2OFST 9B 0 TEXT('OFFSET IN USER SPACE')
L2OFSTPATH 9B 0 TEXT('OFFSET TO PATH NAME')
L2PATH 120A TEXT('PATH NAME')
L2TRNCFLAG 1A TEXT('TRUNCATION FLAG')

The truncation flag is set to Y if the path name stored in the physical file was truncated; otherwise, the flag is set to N.

If any path name found had to be truncated, the command program will send a message similar to the following when the job completes:

Maximum path length = 0000000288

This message is displayed on the screen if the tool was run interactively, and it is also shown in the joblog. If the tool was run from a batch job, the maximum length message will be in the job log as the last message above the CPF1164 Job ended message. As indicated, the message provides the maximum path length found by the tool.

Using the Physical Files Created by the Tool

After a set of physical files have been created by the command, create a query to view the information from the physical files. No queries are provided with the QSPTLIB library. It is possible to create a program that uses the physical files as input and that changes the owner of the owned objects.

Related Tool

Rochester Support Center  document  Tool to List Private Authorities uses the same API and generates a list of the same objects:
The difference between the tools is that the other tool includes all the authority-related fields in the output physical file.

Additional Tools

Rochester Support Center document MCH2804 - CL Source to Change the Ownership of an Object, provides the source of a CL program that can be used to change the owner of library type objects owned by a user profile. To link to document immediately, click here .
There is a CHGOWNALL tool that can be very useful in changing ownership of Integrated File System objects. This tool is described in Rochester Support Center knowledgebase document New, Integrated File System Tools: DEL, DELTREE, ATTRIB, CHGAUTALL, CHGOWNALL, QRYIFSLIB, DLTIFSF, RNMIFSF. To link to document New immediately, click here

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"6.1.0"}]

Historical Number

333464355

Document Information

Modified date:
15 September 2020

UID

nas8N1019219