• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • When IBM i RGZPFM Doesn’t Want To Rebuild Access Paths

    July 30, 2014 Hey, Joe

    I’m trying to run this Reorganize Physical File (RGZPFM) command to reorganize one of my files while it’s active:

    RGZPFM FILE(lib_name/file_name) MBR(member_name)  
    RBDACCPTH(*OPTIMIZE) ALWCANCEL(*YES)  LOCK(*SHRUPD)
    

    But I keep getting this CPF3135 error:

    CPF3135 - Access path for member &2 already in use.
    

    This is not what I anticipated. Am I doing something wrong?

    –Alan

    My guess is that your RGZPFM command will complete correctly if you run the command using these parameters:

    RGZPFM FILE(lib_name/file_name) MBR(member_name)
     RBDACCPTH(*NO) ALWCANCEL(*YES) LOCK(*SHRUPD)
    

    The difference between this command and your command is that the Rebuild Access Paths (RBDACCPTH) parameter in this command is set to *NO, while your RBDACCPTH parameter is set to *OPTIMIZE.

    To explain why this works, here are the three values that RBDACCPTH can be set to and how they affect RGZPFM statements.

    1. If you set RBDACCPTH to *YES, the operating system will rebuild your file’s access path synchronously at the end of your RGZPFM operation. This requires an exclusive file lock for the access path to be rebuilt this way. There are several sources that say setting RBDACCPTH to *YES can result in the reorganization operation failing with a CPF3135 error, if someone else is using the file.

    2. If you set RBDACCPTH to *NO, the file’s access path will be automatically maintained while the RGZPFM operation is running. This should circumvent the CPF3135 message and allow the access path to be rebuilt as RGZPFM is running. Setting RBDACCPTH to *NO also requires that you set your Allow Cancel parameter to *YES, which is no big deal in your case.

    3. If you set RBDACCPTH to *OPTIMIZE as you did, the RGZPFM statement itself will set its RBCACCPTH parameter to either *YES or *NO, depending on which method will result in the access paths being rebuilt the fastest. I’m guessing that when you selected RBDACCPTH to *OPTIMIZE, the OS decided to rebuild the file’s access path synchronously at the end of the RGZPFM (RBDACCPTH = *YES) and that’s what caused the CPF3135 message to appear and your reorg to fail.

    Based on this information, I think there’s a good chance that changing RBDACCPTH to *NO will enable you to run the statement, reorganize your file, and rebuild your access paths while active.

    Unfortunately, reorganizing your file while active doesn’t necessarily get you out of the woods, in terms of shrinking your file size. This RBDACCPTH = *NO parameter may allow you to reorganize your file for performance, but it may not remove the deleted records from your file.

    Here’s some additional info on how using RBDACCPTH works that affects whether deleted records are removed from a reorganized file when RBDACCPTH = *NO.

    A RGZPFM command goes through these four phases when reorganizing a file:

    1. A brief phase where it invalidates all the physical file’s associated access paths, if you’re using the RBDACCPTH=*YES parameter. This doesn’t happen when you use RBDACCPTH=*NO.
    2. It compresses your file and copies the deleted records into the deleted records space.
    3. It rebuilds all the access paths and indexes associated with the physical file.
    4. It deallocates (frees up) your deleted records space if it is able to get an exclusive lock on the file.

    It’s the fourth phase that you need to be aware of. If you’re running a reorg while active, the RGZPFM can only deallocate the deleted records space if it can get an exclusive lock on the file.

    What often happens is that RGZPFM will be able to move all the file’s deleted records to the deleted records space, rebuild the access path, and then stop because it can’t get an exclusive lock on the physical file (something else is using the file). When that happens, you may see the following CPF5729 informational message appear for your job.

    CPF5729 - Not able to allocate object &1
    

    If you’re not able to get an exclusive lock on your physical file/member, then the system will still complete the first three phases. The RGZPFM command will end cleanly but it won’t be able to remove (truncate) the deleted records space from the file. It will only be able to do that if you run your RGZPFM statement when the file is not in use. The file will shrink because of compression and your deleted records will move to the end of the file, but you may or may not be able to remove your deleted records until you run the RGZPFM command again, when the file is not in use by other processes.

    It pays to be aware of this limitation.

    Please let me know if this information works for you.

    HTH

    –Joe

    Joe Hertvik is an IBM i subject matter expert (SME) and the owner of Hertvik Business Services, a service company that provides written marketing content and presentation services for the computer industry, including white papers, case studies, and other marketing material. Email Joe for a free quote for any upcoming projects. He also runs a data center for two companies outside Chicago, featuring multiple IBM i ERP systems. Joe is a contributing editor for IT Jungle and has written the Admin Alert column since 2002. Check out his blog where he features practical information for tech users at joehertvik.com.

    RELATED STORIES

    Admin Alert: Reorganizing IBM i Files To Improve Disk Performance, Part 2

    Admin Alert: Reorganizing IBM i Files To Improve Disk Performance, Part 1



                         Post this story to del.icio.us
                   Post this story to Digg
        Post this story to Slashdot

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    WorksRight Software

    Do you need area code information?
    Do you need ZIP Code information?
    Do you need ZIP+4 information?
    Do you need city name information?
    Do you need county information?
    Do you need a nearest dealer locator system?

    We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!

    The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.

    PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.

    Just call us and we’ll arrange for 30 days FREE use of either ZIP/CITY or PER/ZIP4.

    WorksRight Software, Inc.
    Phone: 601-856-8337
    Fax: 601-856-9432
    Email: software@worksright.com
    Website: www.worksright.com

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    NGS:  NGS-IQ is the complete IBM i query, reporting, and analytics solution.
    System i Developer:  Upgrade your skills at the RPG & DB2 Summit in Minneapolis, Sept 30 - Oct 2.
    COMMON:  Join us at the COMMON 2014 Fall Conference & Expo in Indianapolis, Oct 27-29

    More IT Jungle Resources:

    System i PTF Guide: Weekly PTF Updates
    IBM i Events Calendar: National Conferences, Local Events, and Webinars
    Breaking News: News Hot Off The Press
    TPM @ EnterpriseTech: High Performance Computing Industry News From ITJ EIC Timothy Prickett Morgan

    SAP’s Q2 Bottom Line Pinched By Potential Lawsuit Charges OpenVMS Spinout A Possible Prelude To An IBM i Future?

    Leave a Reply Cancel reply

Volume 14, Number 17 -- July 30, 2014
THIS ISSUE SPONSORED BY:

Bug Busters Software Engineering
WorksRight Software
PowerTech

Table of Contents

  • Decisions, Decisions: Templates Or Snippets?
  • How Do I De-Edit? Let Me Count The Ways
  • When IBM i RGZPFM Doesn’t Want To Rebuild Access Paths

Content archive

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

Recent Posts

  • Liam Allan Shares What’s Coming Next With Code For IBM i
  • From Stable To Scalable: Visual LANSA 16 Powers IBM i Growth – Launching July 8
  • VS Code Will Be The Heart Of The Modern IBM i Platform
  • The AS/400: A 37-Year-Old Dog That Loves To Learn New Tricks
  • IBM i PTF Guide, Volume 27, Number 25
  • Meet The Next Gen Of IBMers Helping To Build IBM i
  • Looks Like IBM Is Building A Linux-Like PASE For IBM i After All
  • Will Independent IBM i Clouds Survive PowerVS?
  • Now, IBM Is Jacking Up Hardware Maintenance Prices
  • IBM i PTF Guide, Volume 27, Number 24

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 © 2025 IT Jungle