• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Reuse Deleted Records? *YES!

    September 12, 2007 Hey, Ted

    How does the iSeries find a space to insert a new record over a deleted record when REUSEDLT(*YES) is specified for a file? An associate says that the file is scanned sequentially for a deleted record when writing a new record to the file and as a result there is a significant performance penalty.

    –Millard

    I sent your question to Kent Milligan of IBM. According to him, “A table scan is not performed. A bitmap-like structure is used to identify available deleted rows within the table.”

    So, Millard, there are no performance-related reasons not to reuse deleted records. This topic reminds me of email I got in response to another article, “Alternatives to Clear Physical File Member.”

    Hey, Ted:
    Is there any reason you didn’t suggest having the file reuse deleted records instead of having to clear it nightly?
    –Jim

    Hey, Ted:
    I suggest the reader set the file to reuse deleted records.

    CHGPF REUSEDLT(*YES)
    

    Then the file won’t have to be cleared or reorganized at all, and thus won’t need to be cleared or reorganized, unless one day there are a huge number of transactions and disk space is at a premium. That’s not a likely problem to have, since disk is cheap. Just add and delete, and the system, as usual, takes care of itself.
    Regards, Hawk

    To answer Jim’s question, I know there’s a lot of old code out that that precedes REUSELDT(*YES), so I just didn’t think of it when I was writing it up.

    Devoted reader Vern also had a good suggestion. He wrote:

    SQL’s DELETE FROM LIB/FILE gets rid of everything. I’m not sure whether it requires the exclusive lock of CLRPFM.
    –Vern

    I gave it a quick test. While one job was displaying a file through the RUNQRY command, I tried CLRPFM from a second job. No good. Then I cranked up SQL in the second job and ran the DELETE command. That worked. However, the two functions are not identical. After CLRPFM completes, the file is empty and there are no deleted records. After DELETE, the file is empty, but there are deleted records.

    As usual, multiple methods exist for removing the outer covering of a feline animal. And it appears that the only time it’s not appropriate to reuse deleted records is when arrival sequence has some meaning.

    Thanks to Kent Milligan for answering Millard’s question.

    –Ted



                         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
    Maxava

    Migrate IBM i with Confidence

    Tired of costly and risky migrations? Maxava Migrate Live minimizes disruption with seamless transitions. Upgrading to Power10 or cloud hosted system, Maxava has you covered!

    Learn More

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    HiT Software:  DBMoto performs real-time as well as snapshot data replication
    COMMON:  Join us at the annual 2008 conference, March 30 - April 3, in Nashville, Tennessee
    NowWhatJobs.net:  NowWhatJobs.net is the resource for job transitions after age 40

    IT Jungle Store Top Book Picks

    The System i Pocket RPG & RPG IV Guide: List Price, $69.95
    The iSeries Pocket Database Guide: List Price, $59.00
    The iSeries Pocket Developers' Guide: List Price, $59.00
    The iSeries Pocket SQL Guide: List Price, $59.00
    The iSeries Pocket Query Guide: List Price, $49.00
    The iSeries Pocket WebFacing Primer: List Price, $39.00
    Migrating to WebSphere Express for iSeries: List Price, $49.00
    iSeries Express Web Implementer's Guide: List Price, $59.00
    Getting Started with WebSphere Development Studio for iSeries: List Price, $79.95
    Getting Started With WebSphere Development Studio Client for iSeries: List Price, $89.00
    Getting Started with WebSphere Express for iSeries: List Price, $49.00
    WebFacing Application Design and Development Guide: List Price, $55.00
    Can the AS/400 Survive IBM?: List Price, $49.00
    The All-Everything Machine: List Price, $29.95
    Chip Wars: List Price, $29.95

    IBM Spreads the developerWorks Love Through New ‘Gizmos’ EGL: The Future of Programming for the System i?

    Leave a Reply Cancel reply

Volume 7, Number 31 -- September 12, 2007
THIS ISSUE SPONSORED BY:

WorksRight Software
Help/Systems
Twin Data

Table of Contents

  • Reuse Deleted Records? *YES!
  • Accessing File Member Timestamps from a .NET C# Program
  • Admin Alert: A Primer for Changing Your i5/OS Startup Program
  • PHP: An Easy Yet Powerful Language Syntax
  • I Want My F15 Back!
  • Admin Alert: Magical & Mysterious iSeries Access CWB Programs

Content archive

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

Recent Posts

  • Public Preview For Watson Code Assistant for i Available Soon
  • COMMON Youth Movement Continues at POWERUp 2025
  • IBM Preserves Memory Investments Across Power10 And Power11
  • Eradani Uses AI For New EDI And API Service
  • Picking Apart IBM’s $150 Billion In US Manufacturing And R&D
  • FAX/400 And CICS For i Are Dead. What Will IBM Kill Next?
  • Fresche Overhauls X-Analysis With Web UI, AI Smarts
  • Is It Time To Add The Rust Programming Language To IBM i?
  • Is IBM Going To Raise Prices On Power10 Expert Care?
  • IBM i PTF Guide, Volume 27, Number 20

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