• 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
    FalconStor

    Begin Your Journey to the Cloud with Hybrid Cloud Date Protection and Disaster Recovery

    FalconStor StorSafe optimizes and modernizes your IBM i on-premises and in the IBM Power Virtual Server Cloud

    FalconStor powers secure and encrypted IBM i backups on-premise and now, working with IBM, powers migration to the IBM PowerVS cloud and on-going backup to IBM cloud object storage.

    Now you can use the IBM PowerVS Cloud as your secure offsite copy and take advantage of a hybrid cloud architecture or you can migrate workloads – test & development or even production apps – to the Power VS Cloud with secure cloud-native backup, powered by FalconStor and proven IBM partners.

    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

  • To Comfort The Afflicted And Afflict The Comfortable
  • How FalconStor Is Reinventing Itself, And Why IBM Noticed
  • Guru: When Procedure Driven RPG Really Works
  • Vendors Fill In The Gaps With IBM’s New MFA Solution
  • IBM i PTF Guide, Volume 27, Number 27
  • With Power11, Power Systems “Go To Eleven”
  • With Subscription Price, IBM i P20 And P30 Tiers Get Bigger Bundles
  • Izzi Buys CNX, Eyes Valence Port To System Z
  • IBM i Shops “Attacking” Security Concerns, Study Shows
  • IBM i PTF Guide, Volume 27, Number 26

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