0% found this document useful (0 votes)
50 views

DB2 For I Tips - Reusing Deleted Records

The document discusses the REUSEDLT option when creating physical files and whether there are any drawbacks to reusing deleted records. It notes that record arrival order and end-of-file delay may not work as expected, and files used as queues should not reuse space. Journaling still functions but the journal entry type differs depending on if a deleted record is reused.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

DB2 For I Tips - Reusing Deleted Records

The document discusses the REUSEDLT option when creating physical files and whether there are any drawbacks to reusing deleted records. It notes that record arrival order and end-of-file delay may not work as expected, and files used as queues should not reuse space. Journaling still functions but the journal entry type differs depending on if a deleted record is reused.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

IT infrastructure Power Systems Software IBM i DB2

Reusing deleted records

Are there any drawbacks to reusing deleted records?


Q: We are considering using the REUSEDLT(*YES) option on the CRTPF
command. The physical file has a fairly consistent pattern of adding blocks of
records and then deleting them. It seems like this option would keep the file at
a more reasonable size.

Are there any drawbacks to using this option? Is it ok that the file is journaled
and under commitment control? Why isn't *YES the default on this option?

A: There are some things to keep in mind when using REUSEDLT(*YES).


Which is why *YES is not the default. If you always want to to reuse deleted
records you can do a Change Command Default (CHGCMDDFT) to change
the default parameter to *YES. The command to do this is as follows:
CHGCMDDFT CMD(CRTPF) NEWDFT('REUSEDLT(*YES)')

Arrival order will no longer have any meaning. Records might not be added to
the end to the file.

End-of-file delay does not work

Relative record number processing should no longer be used

Files used as queues should not reuse deleted record space

There are special considerations when using logical files that use LIFO or
FIFO ordering.

For full detail please reference the AS/400 Database Guide (SC41-9659-02)
page 5-3. There is also some information on page 2-3 & 2-4.

Journaling does work differently when *YES is specified in the REUSEDLT


parameter instead of *NO, but journaling works fine in either case. When a
database record is written to a journaled file that specifies REUSEDLT(*NO), a
PT "Record written to member" entry is generated in the journal. When a
database record is written to a journaled file that specifies REUSEDLT(*YES)
and the write operation did not find a deleted entry to use, a PT entry is still
generated in the journal.

The difference comes when a record is written to a journaled file that specifies
REUSEDLT(*YES) and the write operation actually reuses a deleted record
position in the file. When a deleted record position is actually reused, a PX
"Record added directly to member" entry is written to the journal. APYJRNCHG
and RMVJRNCHG properly handle both the PT and PX entries, and always
applies or removes the correct record image to the correct record position in
the file.

1 of 2 3/19/2018, 7:45 AM
2 of 2 3/19/2018, 7:45 AM

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy